summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/class.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-17 01:31:25 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-17 01:31:25 +0000
commit9a3da8e6cf95762fcbe8511182f9fa98a3318410 (patch)
treeb52d07b2ac39d3ad283c3e5904fd1c326e59984a /clang/test/SemaCXX/class.cpp
parentb5cd01335bfb25a8b1fea027a16651e3d1630733 (diff)
downloadbcm5719-llvm-9a3da8e6cf95762fcbe8511182f9fa98a3318410.tar.gz
bcm5719-llvm-9a3da8e6cf95762fcbe8511182f9fa98a3318410.zip
Provide a test case for PR6629.
llvm-svn: 98702
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-rw-r--r--clang/test/SemaCXX/class.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp
index 743983cd346..508ca4d7652 100644
--- a/clang/test/SemaCXX/class.cpp
+++ b/clang/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<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;
+ };
+ };
+}
OpenPOWER on IntegriCloud