27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3typedef float float_t [[clang::available_only_in_default_eval_method]];4using 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}}7class __attribute__((available_only_in_default_eval_method)) C1 {8};9// expected-error@+1{{'clang::available_only_in_default_eval_method' attribute only applies to typedefs}}10class [[clang::available_only_in_default_eval_method]] C2 {11};12 13// expected-error@+1{{'clang::available_only_in_default_eval_method' attribute only applies to typedefs}}14struct [[clang::available_only_in_default_eval_method]] S1;15// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}16struct __attribute__((available_only_in_default_eval_method)) S2;17 18// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}19void __attribute__((available_only_in_default_eval_method)) foo();20// expected-error@+1{{'clang::available_only_in_default_eval_method' attribute cannot be applied to types}}21void [[clang::available_only_in_default_eval_method]] goo();22// expected-error@+1{{'clang::available_only_in_default_eval_method' attribute cannot be applied to types}}23void bar() [[clang::available_only_in_default_eval_method]];24// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}25void barz() __attribute__((available_only_in_default_eval_method));26 27