brintos

brintos / llvm-project-archived public Read only

0
0
Text · 991 B · 1fc88d3 Raw
17 lines · cpp
1// RUN: %clang_cc1 -triple i386-unknown-unknown -Eonly -verify %s2 3// We warn users if they write an attribute like4// [[__clang__::fallthrough]] because __clang__ is a macro that expands to 1.5// Instead, we suggest users use [[_Clang::fallthrough]] in this situation.6// However, because __has_cpp_attribute (and __has_c_attribute) require7// expanding their argument tokens, __clang__ expands to 1 in the feature test8// macro as well. We don't currently give users a kind warning in this case,9// but we previously did not expand macros and so this would return 0. Now that10// we properly expand macros, users will now get an error about using incorrect11// syntax.12 13__has_cpp_attribute(__clang__::fallthrough) // expected-error {{missing ')' after <numeric_constant>}} \14                                            // expected-note {{to match this '('}} \15                                            // expected-error {{builtin feature check macro requires a parenthesized identifier}}16 17