instantiation, use the set of modules visible from the template definition, not
from whichever declaration the specialization was instantiated from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241662
91177308-0d34-0410-b5e6-
96231b3b80d8
break;
CTD = NewCTD;
}
- return CTD->getTemplatedDecl();
+ return CTD->getTemplatedDecl()->getDefinition();
}
if (auto *CTPSD =
From.dyn_cast<ClassTemplatePartialSpecializationDecl *>()) {
break;
CTPSD = NewCTPSD;
}
- return CTPSD;
+ return CTPSD->getDefinition();
}
}
const CXXRecordDecl *RD = this;
while (auto *NewRD = RD->getInstantiatedFromMemberClass())
RD = NewRD;
- return RD;
+ return RD->getDefinition();
}
}
--- /dev/null
+template<typename, typename = int> struct A;
+template<typename T> struct B;
+
+template<typename, typename> struct A {};
+template<typename T> struct B : A<T> {};
--- /dev/null
+template<typename, typename = int> struct A;
+template<typename T> struct B;
+
+template<typename, typename> struct A {};
+template<typename T> struct B : A<T> {};
+
+inline void f() {
+ B<int> bi;
+}
--- /dev/null
+module X {
+ module A { header "a.h" }
+ module B { header "b.h" }
+}
--- /dev/null
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fno-modules-error-recovery \
+// RUN: -fmodule-name=X -emit-module %S/Inputs/merge-template-pattern-visibility/module.modulemap -x c++ \
+// RUN: -fmodules-local-submodule-visibility