Displaying 2 results from an estimated 2 matches for "__has_warning".
2012 Jul 02
4
[LLVMdev] PROPOSAL: LLVM_FALLTHROUGH macro for intended fall-throughs between switch cases
...]]to a macro, so the code would continue to work
in c++98 mode, but in c++11
mode it would also allow to run this diagnostic (btw, is llvm compilable in
c++11 mode?). Sample implementation of the macro (see *
fallthrough-macro.diff*):
*#ifdef __clang__
**#if __has_feature(cxx_attributes) &&
__has_warning("-Wimplicit-fallthrough")
*
*#define LLVM_FALLTHROUGH [[clang::fallthrough]]
**#endif
**#endif
****#ifndef LLVM_FALLTHROUGH
**#define LLVM_FALLTHROUGH do { } while (0)
**#endif*
After this we can start using *-Wimplicit-fallthrough*.
Please express your opinions on this proposal.
I'...
2012 Jul 26
0
[LLVMdev] PROPOSAL: LLVM_FALLTHROUGH macro for intended fall-throughs between switch cases
...but in c++11 mode it would also allow to run this diagnostic
>>> (btw, is llvm compilable in c++11 mode?). Sample implementation of the
>>> macro (see *fallthrough-macro.diff*):
>>> *#ifdef __clang__
>>> **#if __has_feature(cxx_attributes) &&
>>> __has_warning("-Wimplicit-fallthrough")
>>> *
>>> *#define LLVM_FALLTHROUGH [[clang::fallthrough]]
>>> **#endif
>>> **#endif
>>> ****#ifndef LLVM_FALLTHROUGH
>>> **#define LLVM_FALLTHROUGH do { } while (0)
>>> **#endif*
>>>
>>...