diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index d17d244535..742453046b 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -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 diff --git a/test/SemaTemplate/temp_param.cpp b/test/SemaTemplate/temp_param.cpp index 249bf9a08d..e45d45629a 100644 --- a/test/SemaTemplate/temp_param.cpp +++ b/test/SemaTemplate/temp_param.cpp @@ -39,10 +39,10 @@ template // expected-error{{template parameter missing a default argument}} class B1n; -// FIXME: spurious "shadow" warning! -//template class = Y1, -// template class> -// class B1fixme; +// Check for bogus template parameter shadow warning. +template class, + template class> + class B1noshadow; // C++ [temp.param]p10: template class B2;