1 // RUN: %clang_cc1 %s -x c++ -std=c++11 -triple x86_64-pc-linux -fsyntax-only -verify -Wno-c++17-extensions
2 // RUN: %clang_cc1 %s -x c++ -std=c++11 -triple x86_64-windows-msvc -fsyntax-only -verify=msvc -Wno-c++17-extensions
3 // expected-no-diagnostics
5 // Check we return non-zero values for supported attributes as per
7 static_assert(__has_cpp_attribute(assume
));
9 // The standard does not prescribe a behavior for [[carries_dependency]]
11 static_assert(__has_cpp_attribute(deprecated
));
12 static_assert(__has_cpp_attribute(fallthrough
));
13 static_assert(__has_cpp_attribute(likely
));
14 static_assert(__has_cpp_attribute(unlikely
));
15 static_assert(__has_cpp_attribute(maybe_unused
));
16 static_assert(__has_cpp_attribute(nodiscard
));
17 static_assert(__has_cpp_attribute(noreturn
));
19 // We do not support [[no_unique_address]] in MSVC emulation mode
20 static_assert(__has_cpp_attribute(no_unique_address
)); // msvc-error {{static assertion failed}}