Fix a problem with bogus template shadowing warnings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64230 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index d17d244..7424530 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -251,9 +251,12 @@
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