[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Parser / cxx-keyword-identifiers.cpp
blob471a21a556853afdedfc9f9f012a21f93edcb020
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
4 int foo1(int case, int throw, int y) { // expected-error {{invalid parameter name: 'case' is a keyword}} \
5 expected-error {{invalid}}
6 // Trailing parameters should be recovered.
7 y = 1;
10 int foo2(int case = 1); // expected-error {{invalid parameter}}
11 int foo3(int const); // ok: without parameter name.
12 // ok: override has special meaning when used after method functions. it can be
13 // used as name.
14 int foo4(int override);
15 int foo5(int x const); // expected-error {{expected ')'}} expected-note {{to match this '('}}
16 // FIXME: bad recovery on the case below, "invalid parameter" is desired, the
17 // followon diagnostics should be suppressed.
18 int foo6(int case __attribute((weak))); // expected-error {{invalid parameter}} \
19 // expected-error {{expected ')'}} expected-note {{to match this '('}}
21 void test() {
22 // FIXME: we shoud improve the dianostics for the following cases.
23 int case; // expected-error {{expected unqualified-id}}
24 struct X {
25 int case; // expected-error {{expected member name or ';'}}
28 struct Foo {
29 void bar(*decltype(1) aux); // expected-error {{a type specifier is required for all declarations}}. \
30 // expected-error {{expected ')'}} expected-note {{to match this '('}}