diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-26 04:27:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-26 04:27:47 +0000 |
commit | c8e27cc402043ec86c1698c09e4ee9e415b16207 (patch) | |
tree | 678dcdb449fbdfde7f785102db47b89a988bc914 /test/SemaCXX/nested-name-spec.cpp | |
parent | b76c2322bf5b6d4ff151dcc3c5d2080e1834c4c5 (diff) |
fix PR4452, a crash on invalid. The error recovery is still terrible in this case
but at least we don't crash :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/nested-name-spec.cpp')
-rw-r--r-- | test/SemaCXX/nested-name-spec.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp index 4c3ecee090..c3e4eb18e2 100644 --- a/test/SemaCXX/nested-name-spec.cpp +++ b/test/SemaCXX/nested-name-spec.cpp @@ -171,3 +171,27 @@ Y::foo y; // expected-error{{incomplete type 'struct Y' named in nested name spe X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} \ // expected-error{{C++ requires a type specifier for all declarations}} \ // expected-error{{only constructors take base initializers}} + + + + +namespace somens { + struct a { }; +} + +template <typename T> +class foo { +}; + + +// PR4452 +// FIXME: This error recovery sucks. +foo<somens:a> a2; // expected-error {{unexpected namespace name 'somens': expected expression}} \ +expected-error {{C++ requires a type specifier for all declarations}} + +// FIXME: This is bogus, there is no int here! +somens::a a3 = a2; // expected-error {{cannot initialize 'a3' with an lvalue of type 'int'}} + + + + |