I have included the reflect-cpp header into a source file. It compiles. However if I add:
-fsanitize=undefined
It no longer compiles and complains that:
/app/raw.githubusercontent.com/boost-ext/reflect/main/reflect:1442:35: error: non-constant condition for static assertion
1442 | static_assert(type_id_v<int> != type_id_v<void>);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/app/raw.githubusercontent.com/boost-ext/reflect/main/reflect:1442:35: error: '(reflect::v1_2_5::<lambda()>::_FUN != reflect::v1_2_5::<lambda()>::_FUN)' is not a constant expression
You can see if you remove the -fsanitize=undefined it compiles again. This is a problem only on GCC, not on Clang.
void f(); void g(); static_assert(f != g);: godbolt.org/z/rYa6z7zMK . Appears to be a GCC bug.