16 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -verify=ext -fsyntax-only -Wfuture-attribute-extensions %s2// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -Wno-future-attribute-extensions %s3// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -Wno-c++14-attribute-extensions -Wno-c++17-attribute-extensions -Wno-c++20-attribute-extensions %s4 5// expected-no-diagnostics6 7[[deprecated]] int func1(); // ext-warning {{use of the 'deprecated' attribute is a C++14 extension}}8[[deprecated("msg")]] int func2(); // ext-warning {{use of the 'deprecated' attribute is a C++14 extension}}9 10[[nodiscard]] int func3(); // ext-warning {{use of the 'nodiscard' attribute is a C++17 extension}}11[[nodiscard("msg")]] int func4(); // ext-warning {{use of the 'nodiscard' attribute is a C++20 extension}}12 13void func5() {14 if (true) [[likely]]; // ext-warning {{use of the 'likely' attribute is a C++20 extension}}15}16