[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / attr-only-in-default-eval.cpp
blob510863cf2580a052aef65328e9fac1971a4e3bf3
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef float float_t [[clang::available_only_in_default_eval_method]];
4 using double_t __attribute__((available_only_in_default_eval_method)) = double;
6 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
7 class __attribute__((available_only_in_default_eval_method)) C1 {
8 };
9 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
10 class [[clang::available_only_in_default_eval_method]] C2 {
13 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
14 struct [[clang::available_only_in_default_eval_method]] S1;
15 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
16 struct __attribute__((available_only_in_default_eval_method)) S2;
18 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
19 void __attribute__((available_only_in_default_eval_method)) foo();
20 // expected-error@+1{{'available_only_in_default_eval_method' attribute cannot be applied to types}}
21 void [[clang::available_only_in_default_eval_method]] goo();
22 // expected-error@+1{{'available_only_in_default_eval_method' attribute cannot be applied to types}}
23 void bar() [[clang::available_only_in_default_eval_method]];
24 // expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
25 void barz() __attribute__((available_only_in_default_eval_method));