You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I have a class with a constructor with the following constructor signature cpp_constructor(CTOR ExampleClass str) and try to instantiate it using a blank string for the string argument, like ExampleClass(CTOR my_class ""), the constructor call is redirected to the automatically generated, default constructor with the signature cpp_constructor(CTOR ExampleClass) taking no arguments.
To Reproduce
Minimal example:
include_guard()
include(cmakepp_lang/cmakepp_lang)
cpp_class(ExampleClass)
cpp_constructor(CTOR ExampleClass)
function("${CTOR}" self)
message("The call reached the default constructor with no arguments.")
endfunction()
cpp_constructor(CTOR ExampleClass str)
function("${CTOR}" self arg1)
message("The call reached the expected constructor with an argument.")
endfunction()
cpp_end_class()
ExampleClass(CTOR my_class "")
# Output: The call reached the default constructor with no arguments.
Expected behavior
From a discussion with @ryanmrichard, "CMake functions create a list out of all of the arguments; so your input should have become: CTOR;toolchain_obj;. Without the "" it would be CTOR;toolchain_obj (no trailing semicolon), so the two should be distinguishable."
The text was updated successfully, but these errors were encountered:
Describe the bug
When I have a class with a constructor with the following constructor signature
cpp_constructor(CTOR ExampleClass str)
and try to instantiate it using a blank string for the string argument, likeExampleClass(CTOR my_class "")
, the constructor call is redirected to the automatically generated, default constructor with the signaturecpp_constructor(CTOR ExampleClass)
taking no arguments.To Reproduce
Minimal example:
Expected behavior
From a discussion with @ryanmrichard, "CMake functions create a list out of all of the arguments; so your input should have become: CTOR;toolchain_obj;. Without the "" it would be CTOR;toolchain_obj (no trailing semicolon), so the two should be distinguishable."
The text was updated successfully, but these errors were encountered: