1 // RUN: %clang_cc1 -std=c++11 %s -verify -fno-spell-checking
3 // These test cases are constructed to make clang call ActOnStartOfFunctionDef
6 struct ImplicitDefaultCtor1 {};
8 typedef int NameInClass;
12 // FIXME: Improved our recovery to make this a redeclaration of Foo::f,
13 // even though this is in the wrong namespace. That will allow name lookup to
14 // find NameInClass below. Users are likely to hit this when they forget to
16 // expected-error@+1 {{cannot define or redeclare 'f' here}}
18 switch (0) { case 0: ImplicitDefaultCtor1 o; }
19 // expected-error@+1 {{unknown type name 'NameInClass'}}
24 struct ImplicitDefaultCtor2 {};
25 template <typename T> class TFoo { void f(); };
26 // expected-error@+1 {{nested name specifier 'decltype(TFoo<T>())::'}}
27 template <typename T> void decltype(TFoo<T>())::f() {
28 switch (0) { case 0: ImplicitDefaultCtor1 o; }
32 struct ImplicitDefaultCtor3 {};
33 template <class T1> class A {
34 template <class T2> class B {
40 // expected-error@+1 {{nested name specifier 'A<Y>::B<double>::'}}
41 void A<Y>::B<double>::mf2() {
42 switch (0) { case 0: ImplicitDefaultCtor3 o; }