xref: /aosp_15_r20/external/clang/test/SemaCXX/attr-deprecated-replacement-error.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -verify -fsyntax-only -std=c++11 -fms-extensions %s
2*67e74705SXin Li 
3*67e74705SXin Li #if !__has_feature(attribute_deprecated_with_replacement)
4*67e74705SXin Li #error "Missing __has_feature"
5*67e74705SXin Li #endif
6*67e74705SXin Li 
7*67e74705SXin Li int a1 [[deprecated("warning", "fixit")]]; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
8*67e74705SXin Li int a2 [[deprecated("warning", 1)]]; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
9*67e74705SXin Li 
10*67e74705SXin Li int b1 [[gnu::deprecated("warning", "fixit")]]; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
11*67e74705SXin Li int b2 [[gnu::deprecated("warning", 1)]]; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
12*67e74705SXin Li 
13*67e74705SXin Li __declspec(deprecated("warning", "fixit")) int c1; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
14*67e74705SXin Li __declspec(deprecated("warning", 1)) int c2; // expected-error{{'deprecated' attribute takes no more than 1 argument}}
15*67e74705SXin Li 
16*67e74705SXin Li int d1 __attribute__((deprecated("warning", "fixit")));
17*67e74705SXin Li int d2 __attribute__((deprecated("warning", 1))); // expected-error{{'deprecated' attribute requires a string}}
18