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

2015-03-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
even clang test.c fails. Either rename it to test.cpp or use g++.


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

2015-03-10 Thread npl at chello dot at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

npl at chello dot at changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |---

--- Comment #3 from npl at chello dot at ---
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.


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

2015-03-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #2 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
If you want to compile C++ use g++.


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

2015-03-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

--- Comment #7 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Unfortunately https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02357.html hasn't
been checked in yet.


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

2015-03-10 Thread npl at chello dot at
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)


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

2015-03-10 Thread npl at chello dot at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

--- Comment #8 from npl at chello dot at ---
This (and the Iso recommendation) doesnt answer the question whether the
__has_cpp_attribute macro should be defined for C sources either (it seems
illogical to me).
Guess its undefined and not a bug, I wont bother you anymore =)


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

2015-03-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Why should it?  We don't define __clang_major__.


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

2015-03-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65377

--- Comment #5 from Andrew Pinski pinskia at gcc dot gnu.org ---
Use the proper check if you are want check if you are compiling c++ code first.