[Bug libstdc++/104990] [12 Regression] std::get_time is incompatible with clang 14

bero at lindev dot ch gcc-bugzilla@gcc.gnu.org
Sun Mar 20 13:11:52 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104990

--- Comment #2 from Bernhard Rosenkraenzer <bero at lindev dot ch> ---
clang's __GNUC__ defines depend on a command line -fgnuc-version=

This showed up with -fgnuc-version=11.2 on the command line to work around code
doing broken things like in the particular code being compiled.

#if __GNUC__ > 5
// do something sane
#else
// insane workaround because gcc 4.x was missing features
// both gcc and clang have these days
#endif

So probably only few people will run into this -- but it's probably worth
changing

#if __GNUC__ >= 5

to

#if __GNUC__ >= 5 && !defined(__clang__)

(or alternatively adding the extension to clang).


More information about the Gcc-bugs mailing list