From 7a591a4a46eba3e498e7d6637cbf9c01bb18171f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 8 Jul 2015 02:22:15 +0000 Subject: [modules] When determining the visible module set during template instantiation, use the set of modules visible from the template definition, not from whichever declaration the specialization was instantiated from. llvm-svn: 241662 --- clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h | 5 +++++ clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h | 9 +++++++++ .../Inputs/merge-template-pattern-visibility/module.modulemap | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h create mode 100644 clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h create mode 100644 clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap (limited to 'clang/test/Modules/Inputs/merge-template-pattern-visibility') diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h b/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h new file mode 100644 index 00000000000..7f9b6497e72 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h @@ -0,0 +1,5 @@ +template struct A; +template struct B; + +template struct A {}; +template struct B : A {}; diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h new file mode 100644 index 00000000000..5ed18e7e7c5 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h @@ -0,0 +1,9 @@ +template struct A; +template struct B; + +template struct A {}; +template struct B : A {}; + +inline void f() { + B bi; +} diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap b/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap new file mode 100644 index 00000000000..ba97abbaa8e --- /dev/null +++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap @@ -0,0 +1,4 @@ +module X { + module A { header "a.h" } + module B { header "b.h" } +} -- cgit v1.2.3