Allow disabling use of __builtin_constant_p in internal macros

Turns out that even in GCC, the expression in `__builtin_cosntant_p`
can end up evaluated and side-effects executed. To allow users to
work around this bug, I added a configuration option to disable its
use in internal macros.

Related to #2925
This commit is contained in:
Martin Hořeňovský
2024-10-27 17:08:47 +01:00
parent 7c2e1fb1b2
commit e260288807
5 changed files with 60 additions and 31 deletions

View File

@@ -56,6 +56,8 @@ expand_template(
"#cmakedefine CATCH_CONFIG_WCHAR": "",
"#cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG": "",
"#cmakedefine CATCH_CONFIG_WINDOWS_SEH": "",
"#cmakedefine CATCH_CONFIG_USE_BUILTIN_CONSTANT_P": "",
"#cmakedefine CATCH_CONFIG_NO_USE_BUILTIN_CONSTANT_P": "",
},
template = "src/catch2/catch_user_config.hpp.in",
)