mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 09:16:38 +00:00

The values for `__has_cpp_attribute` don't have to be guarded behind `LangOpts.CPlusPlus` because `__has_cpp_attribute` isn't available if Clang isn't in a C++ mode. Fixes #82995
10 lines
231 B
C++
10 lines
231 B
C++
// RUN: %clang_cc1 -std=c++03 -fsyntax-only %s
|
|
|
|
// Ensure that __has_cpp_attribute and argument parsing work in C++03
|
|
|
|
#if !__has_cpp_attribute(nodiscard)
|
|
# error
|
|
#endif
|
|
|
|
[[gnu::assume_aligned(4)]] void* g() { return __nullptr; }
|