mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 15:36:05 +00:00

a '#pragma clang fp eval_method, it can lead to ABI breakage. See https://godbolt.org/z/56zG4Wo91 This patch prevents this. Differential Revision: https://reviews.llvm.org/D153590
27 lines
1.5 KiB
C++
27 lines
1.5 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
typedef float float_t [[clang::available_only_in_default_eval_method]];
|
|
using double_t __attribute__((available_only_in_default_eval_method)) = double;
|
|
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
class __attribute__((available_only_in_default_eval_method)) C1 {
|
|
};
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
class [[clang::available_only_in_default_eval_method]] C2 {
|
|
};
|
|
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
struct [[clang::available_only_in_default_eval_method]] S1;
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
struct __attribute__((available_only_in_default_eval_method)) S2;
|
|
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
void __attribute__((available_only_in_default_eval_method)) foo();
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute cannot be applied to types}}
|
|
void [[clang::available_only_in_default_eval_method]] goo();
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute cannot be applied to types}}
|
|
void bar() [[clang::available_only_in_default_eval_method]];
|
|
// expected-error@+1{{'available_only_in_default_eval_method' attribute only applies to typedefs}}
|
|
void barz() __attribute__((available_only_in_default_eval_method));
|
|
|