]> granicus.if.org Git - clang/commitdiff
Provide a test case for PR6629.
authorJohn McCall <rjmccall@apple.com>
Wed, 17 Mar 2010 01:31:25 +0000 (01:31 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 17 Mar 2010 01:31:25 +0000 (01:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98702 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/class.cpp

index 743983cd346199ae6cfab475f60a3fc10f0b1f3a..508ca4d7652a5bf7102462ccffdbb5b1984a7d29 100644 (file)
@@ -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<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;
+    };
+  };
+}