From: John McCall Date: Wed, 17 Mar 2010 01:31:25 +0000 (+0000) Subject: Provide a test case for PR6629. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ad287edcc7c019c413484b86feb8457701eaccd;p=clang Provide a test case for PR6629. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98702 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp index 743983cd34..508ca4d765 100644 --- a/test/SemaCXX/class.cpp +++ b/test/SemaCXX/class.cpp @@ -118,3 +118,21 @@ struct S void S::f() {} // expected-error {{class member cannot be redeclared}} expected-note {{previous declaration}} expected-note {{previous definition}} void f() {} // expected-error {{class member cannot be redeclared}} expected-error {{redefinition}} }; + +// Don't crash on this bogus code. +namespace pr6629 { + // TODO: most of these errors are spurious + template struct foo : + bogus > // expected-error {{unknown template name 'bogus'}} \ + // BOGUS expected-error {{expected '{' after base class list}} \ + // BOGUS expected-error {{expected ';' after struct}} \ + // BOGUS expected-error {{expected unqualified-id}} \ + { }; + + template<> struct foo { // why isn't there an error here? + template struct bar { + typedef bar type; + static const int value = 0; + }; + }; +}