summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-09-12 21:06:40 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-09-12 21:06:40 +0000
commit6561f92b6237b17006a4b25f72a0085972b7765a (patch)
tree997983c1144f035d25eb8e40d60b17b12608cd2f /clang/test/Modules
parent2f98f31c77a9db44eae9fef9be79611735e150b2 (diff)
downloadbcm5719-llvm-6561f92b6237b17006a4b25f72a0085972b7765a.tar.gz
bcm5719-llvm-6561f92b6237b17006a4b25f72a0085972b7765a.zip
[modules] When we merge two definitions of a function, mark the retained
definition as visible in the discarded definition's module, as we do for other kinds of definition. llvm-svn: 281258
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h9
-rw-r--r--clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap4
-rw-r--r--clang/test/Modules/merge-template-pattern-visibility.cpp14
3 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h
index 6db3c2c6c9f..41b52d5e6ab 100644
--- a/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h
+++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h
@@ -9,3 +9,12 @@ inline void f() {
B<int> bi;
C(0);
}
+
+namespace CrossModuleMerge {
+ template<typename, typename = int> struct A;
+ template<typename T> struct B;
+
+ template<typename, typename> struct A {};
+ template<typename T> struct B : A<T> {};
+ template<typename T> inline auto C(T) {}
+}
diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap b/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap
index ba97abbaa8e..e00d1b9551e 100644
--- a/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap
+++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/module.modulemap
@@ -2,3 +2,7 @@ module X {
module A { header "a.h" }
module B { header "b.h" }
}
+module Y {
+ module C { header "c.h" }
+ module D { header "d.h" }
+}
diff --git a/clang/test/Modules/merge-template-pattern-visibility.cpp b/clang/test/Modules/merge-template-pattern-visibility.cpp
index b97f9f113e3..ec5aa26c68d 100644
--- a/clang/test/Modules/merge-template-pattern-visibility.cpp
+++ b/clang/test/Modules/merge-template-pattern-visibility.cpp
@@ -2,3 +2,17 @@
// RUN: %clang_cc1 -fmodules -fno-modules-error-recovery -std=c++14 \
// RUN: -fmodule-name=X -emit-module %S/Inputs/merge-template-pattern-visibility/module.modulemap -x c++ \
// RUN: -fmodules-local-submodule-visibility -o %t/X.pcm
+// RUN: %clang_cc1 -fmodules -fno-modules-error-recovery -std=c++14 \
+// RUN: -fmodule-name=Y -emit-module %S/Inputs/merge-template-pattern-visibility/module.modulemap -x c++ \
+// RUN: -fmodules-local-submodule-visibility -o %t/Y.pcm
+// RUN: %clang_cc1 -fmodules -fno-modules-error-recovery -std=c++14 -fmodule-file=%t/X.pcm -fmodule-file=%t/Y.pcm \
+// RUN: -fmodules-local-submodule-visibility -verify %s -I%S/Inputs/merge-template-pattern-visibility
+
+#include "b.h"
+#include "d.h"
+
+// expected-no-diagnostics
+void g() {
+ CrossModuleMerge::B<int> bi;
+ CrossModuleMerge::C(0);
+}
OpenPOWER on IntegriCloud