Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use exact type for temporary variable wrapping parameters with defaul…
…t 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 ;
- Loading branch information