Open davidstone opened 5 years ago
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91259 for the bug report against gcc
I'm not sure if this is a bug on our side or not... Checking with caseycarter who added this macro originally.
Looks like this is fixed on trunk for libstdc++: https://gcc.gnu.org/ml/gcc-patches/2019-07/msg01090.html . However, clang claims libstdc++ compatibility, so it cannot define __cpp_concepts for this version of gcc unless it accepts the code.
Anyway the solution here is not to undefine __cpp_concepts but rather to set it to the correct value. In this specific case it wouldn't matter because libstdc++ simply checked for the non-zeroness of the __cpp_concepts flag and not for its value, which is in any case a bug on their end.
libstdc++ uses __cpp_concepts to check if concepts are enabled. Unfortunately, it is going off a very old version of concepts that did not require parenthesizing expressions that are not just concepts or just a value of type bool. This means that using clang with libstdc++ gives error messages like:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9/memory:232:14: error: expected primary expression before '!'; did you forget parentheses? requires ! _Std_pair<_Tp>