[cfe-commits] r98702 - /cfe/trunk/test/SemaCXX/class.cpp
John McCall
rjmccall at apple.com
Tue Mar 16 18:31:25 PDT 2010
Author: rjmccall
Date: Tue Mar 16 20:31:25 2010
New Revision: 98702
URL: http://llvm.org/viewvc/llvm-project?rev=98702&view=rev
Log:
Provide a test case for PR6629.
Modified:
cfe/trunk/test/SemaCXX/class.cpp
Modified: cfe/trunk/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class.cpp?rev=98702&r1=98701&r2=98702&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/class.cpp (original)
+++ cfe/trunk/test/SemaCXX/class.cpp Tue Mar 16 20:31:25 2010
@@ -118,3 +118,21 @@
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<class T1, class T2> struct foo :
+ bogus<foo<T1,T2> > // 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<unknown,unknown> { // why isn't there an error here?
+ template <typename U1, typename U2> struct bar {
+ typedef bar type;
+ static const int value = 0;
+ };
+ };
+}
More information about the cfe-commits
mailing list