http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652

--- Comment #28 from Alexander Kornienko <alexfh at google dot com> ---
(In reply to Jonathan Wakely from comment #24)
> (In reply to Matthew Woehlke from comment #22)
> >     [[gcc:fallthrough]] // suppress warning for fall-through to 'case C'
> 
> N.B. the attribute-namespace for GNU extensions is "gnu"

And also the attribute must be attached to a declaration or a statement. In
Clang, the [[clang::fallthrough]] attribute is attached to an empty statement
';', so the syntax actually is:

switch (x) {
  case 1:
    ...
    [[clang::fallthrough]];  // <- note the semicolon

  case 2:
    ...

Reply via email to