This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation. llvm-svn: 369033
17 lines
406 B
C
17 lines
406 B
C
// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s
|
|
|
|
// CHECK: has_fallthrough
|
|
#if __has_c_attribute(fallthrough)
|
|
int has_fallthrough();
|
|
#endif
|
|
|
|
// CHECK: does_not_have_selectany
|
|
#if !__has_c_attribute(selectany)
|
|
int does_not_have_selectany();
|
|
#endif
|
|
|
|
// CHECK: has_nodiscard_underscore
|
|
#if __has_c_attribute(__nodiscard__)
|
|
int has_nodiscard_underscore();
|
|
#endif
|