32 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s2 3 4int 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 10int foo2(int case = 1); // expected-error {{invalid parameter}}11int foo3(int const); // ok: without parameter name.12// ok: override has special meaning when used after method functions. it can be13// used as name.14int foo4(int override);15int foo5(int x const); // expected-error {{expected ')'}} expected-note {{to match this '('}}16// FIXME: bad recovery on the case below, "invalid parameter" is desired, the17// followon diagnostics should be suppressed.18int foo6(int case __attribute((weak))); // expected-error {{invalid parameter}} \19 // expected-error {{expected ')'}} expected-note {{to match this '('}}20 21void 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}28struct 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 '('}}31};32