public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65377] New: [5.0 Regression] cpp attribute check ala clang fails to compile
@ 2015-03-10 10:40 npl at chello dot at
  2015-03-10 10:44 ` [Bug c/65377] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: npl at chello dot at @ 2015-03-10 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65377
           Summary: [5.0 Regression] cpp attribute check ala clang fails
                    to compile
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: npl at chello dot at

The following code fails to compile with gcc-5-20150301, gcc 4.8.4 and 4.9.2
are fine.
The command used is simply "gcc test.c"

--------------------
#ifndef __has_cpp_attribute         // Optional of course.
#  define __has_cpp_attribute(x) 0  // Compatibility with non-clang compilers.
#endif

#if __has_cpp_attribute(clang::fallthrough) || (defined(__clang__) &&
__clang_major__ >= 4 || (__clang_major__ == 3 &&__clang_minor__ >= 3))
#  define FALLTHROUGH [[clang::fallthrough]];
#else
#  define FALLTHROUGH
#endif

int main()
{
}
--------------------


Error Message is:
test.c:5:30: error: missing ')' after "__has_attribute"
 #if __has_cpp_attribute(clang::fallthrough) || (defined(__clang__) &&
__clang_major__ >= 4 || (__clang_major__ == 3 &&__clang_minor__ >= 3))
                              ^
test.c:5:31: error:  ':' without preceding '?'
 #if __has_cpp_attribute(clang::fallthrough) || (defined(__clang__) &&
__clang_major__ >= 4 || (__clang_major__ == 3 &&__clang_minor__ >= 3))
                               ^


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-10 11:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 10:40 [Bug c/65377] New: [5.0 Regression] cpp attribute check ala clang fails to compile npl at chello dot at
2015-03-10 10:44 ` [Bug c/65377] " mpolacek at gcc dot gnu.org
2015-03-10 10:46 ` trippels at gcc dot gnu.org
2015-03-10 10:52 ` npl at chello dot at
2015-03-10 10:59 ` trippels at gcc dot gnu.org
2015-03-10 11:01 ` pinskia at gcc dot gnu.org
2015-03-10 11:02 ` npl at chello dot at
2015-03-10 11:07 ` trippels at gcc dot gnu.org
2015-03-10 11:19 ` npl at chello dot at

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).