Actions.ActOnReenterTemplateScope(getCurScope(), MD);
++CurTemplateDepthTracker;
} else if (CXXRecordDecl *MD = dyn_cast_or_null<CXXRecordDecl>(*II)) {
- bool ManageScope = MD->getDescribedClassTemplate() != 0;
+ bool IsClassTemplate = MD->getDescribedClassTemplate() != 0;
TemplateParamScopeStack.push_back(
- new ParseScope(this, Scope::TemplateParamScope, ManageScope));
+ new ParseScope(this, Scope::TemplateParamScope,
+ /*ManageScope*/IsClassTemplate));
Actions.ActOnReenterTemplateScope(getCurScope(),
MD->getDescribedClassTemplate());
- ++CurTemplateDepthTracker;
+ if (IsClassTemplate)
+ ++CurTemplateDepthTracker;
}
TemplateParamScopeStack.push_back(new ParseScope(this, Scope::DeclScope));
Actions.PushDeclContext(Actions.getCurScope(), *II);
Outer<int>::outer_mem(int, char); //expected-note{{in instantiation of}}
}
+
+namespace more_nested_local_templates {
+
+int test() {
+ struct Local {
+ template<class U> void foo(U u) {
+ struct Inner {
+ template<class A>
+ auto operator()(A a, U u2) -> U {
+ return u2;
+ };
+ };
+ Inner GL;
+ GL('a', u );
+ GL(3.14, u );
+ }
+ };
+ Local l;
+ l.foo("nmabc");
+ return 0;
+}
+int t = test();
+}
\ No newline at end of file