On 7/20/2021 4:01 PM, Marek Polacek via Gcc-patches wrote:
This quashes -Wundef warnings in ansidecl.h when compiled in C or C++.
In C, __cpp_constexpr and __cplusplus aren't defined so we evaluate
them to 0; conversely, __STDC_VERSION__ is not defined in C++.
This has caused grief when -Wundef is used with -Werror.

I've also tested -traditional-cpp.

Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?

include/ChangeLog:

        * ansidecl.h: Check if __cplusplus is defined before checking
        the value of __cpp_constexpr and __cplusplus.  Don't check
        __STDC_VERSION__ in C++.
OK
jeff

Reply via email to