1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2
3
foo1(int case,int throw,int y)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;
8 }
9
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 '('}}
20
test()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 ';'}}
26 };
27 }
28