Patch by Erik Pilkington!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265571
91177308-0d34-0410-b5e6-
96231b3b80d8
}
TemplateParameterList *TemplateParams = TemplateParamLists[0];
+ // Check that we can declare a template here.
+ if (CheckTemplateDeclScope(S, TemplateParams))
+ return nullptr;
+
// Only consider previous declarations in the same scope.
FilterLookupForScope(Previous, CurContext, S, /*ConsiderLinkage*/false,
/*ExplicitInstantiationOrSpecialization*/false);
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
template <typename>
void quux();
template <typename> struct bar {}; // expected-error{{templates cannot be declared inside of a local class}}
template <typename> void baz() {} // expected-error{{templates cannot be declared inside of a local class}}
template <typename> void qux(); // expected-error{{templates cannot be declared inside of a local class}}
+ template <typename> using corge = int; // expected-error{{templates cannot be declared inside of a local class}}
+ template <typename T> static T grault; // expected-error{{static data member}} expected-error{{templates cannot be declared inside of a local class}}
};
}