This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165005
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!AddResult || Existing)
return;
- DeclContext *DC = New->getDeclContext()->getRedeclContext();
+ DeclContext *DC = New->getLexicalDeclContext();
if (DC->isTranslationUnit() && Reader.SemaObj) {
if (Reader.SemaObj->IdResolver.tryAddTopLevelDecl(New, New->getDeclName()))
Reader.RedeclsAddedToAST.insert(New);
public:
void push_back(T);
};
+
+namespace A {
+ class Y {
+ template <typename T> friend class WhereAmI;
+ };
+}
+
+template <typename T> class A::WhereAmI {
+public:
+ static void func() {}
+};