[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / suppress.cpp
blobd88ae0bbca00f9526b7c6abe1209c06521f4c4ed
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -verify
3 [[gsl::suppress("globally")]];
5 namespace N {
6 [[gsl::suppress("in-a-namespace")]];
9 [[gsl::suppress("readability-identifier-naming")]]
10 void f_() {
11 int *p;
12 [[gsl::suppress("type", "bounds")]] {
13 p = reinterpret_cast<int *>(7);
16 [[gsl::suppress]] int x; // expected-error {{'suppress' attribute takes at least 1 argument}}
17 [[gsl::suppress()]] int y; // expected-error {{'suppress' attribute takes at least 1 argument}}
18 int [[gsl::suppress("r")]] z; // expected-error {{'suppress' attribute cannot be applied to types}}
19 [[gsl::suppress(f_)]] float f; // expected-error {{'suppress' attribute requires a string}}
22 union [[gsl::suppress("type.1")]] U {
23 int i;
24 float f;