summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/libstdcxx-ambiguous-internal.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-10-21 07:13:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-10-21 07:13:52 +0000
commit896c66ecc64e9f8fa80b08b8d9d7eecfce5c3acd (patch)
tree495d1a16c5c55d9c63c4a537b467fb9f7245213c /clang/test/Modules/libstdcxx-ambiguous-internal.cpp
parent4215236621357cb4b21dfbcfc6e87bc3c222e9f1 (diff)
downloadbcm5719-llvm-896c66ecc64e9f8fa80b08b8d9d7eecfce5c3acd.tar.gz
bcm5719-llvm-896c66ecc64e9f8fa80b08b8d9d7eecfce5c3acd.zip
[modules] libstdc++ defines some static inline functions in its internal
headers. If those headers end up being textually included twice into the same module, we get ambiguity errors. Work around this by downgrading the ambiguity error to a warning if multiple identical internal-linkage functions appear in an overload set, and just pick one of those functions as the lookup result. llvm-svn: 250884
Diffstat (limited to 'clang/test/Modules/libstdcxx-ambiguous-internal.cpp')
-rw-r--r--clang/test/Modules/libstdcxx-ambiguous-internal.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Modules/libstdcxx-ambiguous-internal.cpp b/clang/test/Modules/libstdcxx-ambiguous-internal.cpp
new file mode 100644
index 00000000000..966b9c97681
--- /dev/null
+++ b/clang/test/Modules/libstdcxx-ambiguous-internal.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -emit-module -fmodule-name=std -fmodules-cache-path=%t %S/Inputs/libstdcxx-ambiguous-internal/module.modulemap -Werror
+// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -emit-module -fmodule-name=std -fmodules-cache-path=%t %S/Inputs/libstdcxx-ambiguous-internal/module.modulemap -fmodules-local-submodule-visibility -DAMBIGUOUS 2>&1| FileCheck %s
+
+// CHECK-NOT: error
+// CHECK: warning: ambiguous use of internal linkage function 'f' defined in multiple modules
+// CHECK-NOT: error
OpenPOWER on IntegriCloud