xref: /llvm-project/clang/test/Sema/attr-only-in-default-eval.cpp (revision 63b0b82fd6bee672fa20078aa2fbe3c4ee2b8970)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 typedef float float_t [[clang::available_only_in_default_eval_method]];
4 using double_t __attribute__((available_only_in_default_eval_method)) = double;
5 
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 {
11 };
12 
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;
17 
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));
26 
27