[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / attr-standalonedebug.cpp
blob540dd5f79af5bbe0da2044775bf6167bbc7c2aed
1 // RUN: %clang_cc1 %s -verify -fsyntax-only
2 // RUN: %clang_cc1 %s -verify -fsyntax-only -x c
4 #ifdef __cplusplus
5 int a __attribute__((standalone_debug)); // expected-warning {{'standalone_debug' attribute only applies to classes}}
7 void __attribute__((standalone_debug)) b(); // expected-warning {{'standalone_debug' attribute only applies to classes}}
9 struct __attribute__((standalone_debug(1))) c {}; // expected-error {{'standalone_debug' attribute takes no arguments}}
11 #else
12 // Check that attribute only works in C++.
13 struct __attribute__((standalone_debug)) a {}; // expected-warning {{'standalone_debug' attribute ignored}}
14 #endif