Provide a test case for PR6629.

llvm-svn: 98702
This commit is contained in:
John McCall 2010-03-17 01:31:25 +00:00
parent b5cd01335b
commit 9a3da8e6cf
1 changed files with 18 additions and 0 deletions

View 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;
};
};
}