[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
diff --git a/clang/test/Modules/libstdcxx-ambiguous-internal.cpp b/clang/test/Modules/libstdcxx-ambiguous-internal.cpp
new file mode 100644
index 0000000..966b9c9
--- /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