PR15017: A '>' can appear after a type-specifier in a template-argument-list.

It turns out that there's no correctness bug here (because we can't have a type
definition in this location), but there was a diagnostic bug.

llvm-svn: 173766
This commit is contained in:
Richard Smith 2013-01-29 04:13:32 +00:00
parent ff37d94e6f
commit 52c5b87cc9
2 changed files with 7 additions and 0 deletions

View File

@ -1015,6 +1015,9 @@ bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) {
case tok::l_square: // enum E [[]] x
// Note, no tok::kw_alignas here; alignas cannot appertain to a type.
return getLangOpts().CPlusPlus11 && NextToken().is(tok::l_square);
case tok::greater:
// template<class T = class X>
return getLangOpts().CPlusPlus;
}
return false;
}

View File

@ -180,6 +180,10 @@ void test (DIE die, DIE *Die, DIE INT, DIE *FLOAT) {
FLOAT->foo();
}
namespace PR15017 {
template<typename T = struct X { int i; }> struct S {}; // expected-error {{'PR15017::X' can not be defined in a type specifier}}
}
// PR8380
extern "" // expected-error {{unknown linkage language}}
test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \