summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-01-12 20:34:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-01-12 20:34:32 +0000
commit2de44e658d62f1032111933a5b751f17fc477c55 (patch)
tree55daa1a3c6498b6684ff61f4f31908f745f766b7 /clang/test
parent3469ee120c753c60875ddc301ea7921700b8730a (diff)
downloadbcm5719-llvm-2de44e658d62f1032111933a5b751f17fc477c55.tar.gz
bcm5719-llvm-2de44e658d62f1032111933a5b751f17fc477c55.zip
[modules] Don't diagnose a conflict between two using-declarations that name equivalent internal linkage entities.
llvm-svn: 257512
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/using-decl-redecl/a.h3
-rw-r--r--clang/test/Modules/Inputs/using-decl-redecl/d.h1
-rw-r--r--clang/test/Modules/Inputs/using-decl-redecl/module.modulemap5
-rw-r--r--clang/test/Modules/using-decl-redecl.cpp12
4 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Modules/Inputs/using-decl-redecl/a.h b/clang/test/Modules/Inputs/using-decl-redecl/a.h
index 477546945c0..eaa1876aac6 100644
--- a/clang/test/Modules/Inputs/using-decl-redecl/a.h
+++ b/clang/test/Modules/Inputs/using-decl-redecl/a.h
@@ -1,2 +1,3 @@
struct string {};
-namespace N { typedef ::string clstring; }
+const int n = 0;
+namespace N { typedef ::string clstring; using ::n; }
diff --git a/clang/test/Modules/Inputs/using-decl-redecl/d.h b/clang/test/Modules/Inputs/using-decl-redecl/d.h
new file mode 100644
index 00000000000..2243de1baf9
--- /dev/null
+++ b/clang/test/Modules/Inputs/using-decl-redecl/d.h
@@ -0,0 +1 @@
+#include "a.h"
diff --git a/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap b/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap
index bd6ea830c2d..a2ebc176764 100644
--- a/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap
+++ b/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap
@@ -1,3 +1,4 @@
module a { header "a.h" }
-module b { header "b.h" export * }
-module c { header "c.h" export * }
+module b { header "b.h" export a }
+module c { header "c.h" export a export b }
+module d { header "d.h" }
diff --git a/clang/test/Modules/using-decl-redecl.cpp b/clang/test/Modules/using-decl-redecl.cpp
index 0e78cec1188..0524052fce5 100644
--- a/clang/test/Modules/using-decl-redecl.cpp
+++ b/clang/test/Modules/using-decl-redecl.cpp
@@ -2,10 +2,20 @@
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t \
// RUN: -fmodule-map-file=%S/Inputs/using-decl-redecl/module.modulemap \
// RUN: -I%S/Inputs/using-decl-redecl \
+// RUN: -Wno-modules-ambiguous-internal-linkage \
// RUN: -verify %s
+
+#include "d.h"
+
+const int n = 0;
+namespace M { using ::n; }
+
#include "c.h"
+
N::clstring y = b;
// Use a typo to trigger import of all declarations in N.
N::clstrinh s; // expected-error {{did you mean 'clstring'}}
-// expected-note@a.h:2 {{here}}
+// expected-note@a.h:3 {{here}}
+
+namespace M { using N::n; }
OpenPOWER on IntegriCloud