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
Use exact type for temporary variable wrapping parameters with default args and compactdefaultargs
When wrapping a default argument such as 'const bool& x = true'
a variable with the exact same type, such as:
bool const &arg2_defvalue = true;
is now used in the generated code instead of a dereferenced type:
bool arg2_defvalue = true;
This can still be used for the wrapped argument without any other
changes:
bool *arg2 = (bool *) &arg2_defrvalue;
and the lifetimes are still the same for the temporary variable.
Works around some typedef issues for enum classes introduced in the
previous commit in the cpp11_strongly_typed_enumerations testcase,
when wrapping a parameter 'const PRINT_SETUP& e = PRINT_SETUP::TO_CONSOLE'
The temporary variable being generated became:
enum MyClass::PRINT_SETUP arg2_defvalue = MyClass::PRINT_SETUP::TO_CONSOLE ;
The enum in the type is wrong for an enum class. Now the original type
is used:
MyClass::PRINT_SETUP const &arg2_defvalue = MyClass::PRINT_SETUP::TO_CONSOLE ;
0 commit comments