Hi,
On Sun, May 27, 2012 at 1:55 PM, Matthieu Monrocq <
[email protected]> wrote:
> One question: in the proposed macro, why not put the the `;` in the macro
> since it will be mandatory anyway ?
>
Keeping semicolon out of macro is intentional. That way macro usage looks
like a statement (which it is).
Also, it might be easier to just do:
>
> #if defined(__has_feature) and __has_feature(cxx_attributes)
> # define FALLTHROUGH [[clang::fallthrough]];
> #else
> # define FALLTHROUGH while(0) {}
> #endif
>
Unfortunately, it will not work at least on gcc, because it tries to parse
the whole #if condition at once and emits an error on __has_feature(...).
--
Best regards,
Alexander Kornienko
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits