Fix a problem with bogus template shadowing warnings

llvm-svn: 64230
This commit is contained in:
Douglas Gregor 2009-02-10 19:52:54 +00:00
parent dba326363c
commit 85e8b3eeed
2 changed files with 10 additions and 7 deletions

View File

@ -251,9 +251,12 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
SourceLocation TemplateLoc = ConsumeToken();
TemplateParameterList TemplateParams;
SourceLocation LAngleLoc, RAngleLoc;
if(!ParseTemplateParameters(Depth + 1, TemplateParams, LAngleLoc,
RAngleLoc)) {
return 0;
{
ParseScope TemplateParmScope(this, Scope::TemplateParamScope);
if(!ParseTemplateParameters(Depth + 1, TemplateParams, LAngleLoc,
RAngleLoc)) {
return 0;
}
}
// Generate a meaningful error if the user forgot to put class before the

View File

@ -39,10 +39,10 @@ template<int N = 5, // expected-note{{previous default template argument define
int M> // expected-error{{template parameter missing a default argument}}
class B1n;
// FIXME: spurious "shadow" warning!
//template<template<class T> class = Y1,
// template<class T> class>
// class B1fixme;
// Check for bogus template parameter shadow warning.
template<template<class T> class,
template<class T> class>
class B1noshadow;
// C++ [temp.param]p10:
template<class T1, class T2 = int> class B2;