[Bug c/65377] [5.0 Regression] cpp attribute check ala clang fails to compile

npl at chello dot at gcc-bugzilla@gcc.gnu.org
Tue Mar 10 11:02:00 GMT 2015


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

--- Comment #6 from npl at chello dot at ---
(In reply to npl from comment #3)
> 1) It simply shouldnt fail.
> 2) this is a generic header for C and C++.
> 
> __has_cpp_attribute(clang::fallthrough) should resolve to 0 and not fail.
> This is a bug in gcc, unless you can explain why it shouldnt resolve to 0.

I think gcc should simply ignore the __has_cpp_attribute macro, unless it does
compile C++ code?
if I use other names than __has_cpp_attribute it compiles. I will put some C++
guards around this code, but I still think this is a bug?

(And I am compiling with Clang 3.4, but this doesnt support the feature check)



More information about the Gcc-bugs mailing list