summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-10-30 22:38:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-10-30 22:38:20 +0000
commita544c51e94445ad655e512af690cb214aac73321 (patch)
tree739fe9801166944b5cd640726f2bfb66acad10d1 /clang/test
parent9cd7abbcff7699f5b74e2e5242d7ff5a18c77f49 (diff)
downloadbcm5719-llvm-a544c51e94445ad655e512af690cb214aac73321.tar.gz
bcm5719-llvm-a544c51e94445ad655e512af690cb214aac73321.zip
[modules] Retain multiple using-directives in the same scope even if they name the same namespace.
They might have different visibility, and thus discarding all but one of them can result in rejecting valid code. Also fix name lookup to cope with multiple using-directives being found that denote the same namespace, where some are not visible -- don't cache an "already visited" state for a using-directive that we didn't visit because it was hidden. llvm-svn: 316965
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/using-directive-redecl.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/Modules/using-directive-redecl.cpp b/clang/test/Modules/using-directive-redecl.cpp
new file mode 100644
index 00000000000..94772f30a3d
--- /dev/null
+++ b/clang/test/Modules/using-directive-redecl.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -verify %s
+// expected-no-diagnostics
+#pragma clang module build M
+module M { module TDFNodes {} module TDFInterface {} }
+#pragma clang module contents
+ // TDFNodes
+ #pragma clang module begin M.TDFNodes
+ namespace Detail {
+ namespace TDF {
+ class TLoopManager {};
+ }
+ }
+ namespace Internal {
+ namespace TDF {
+ using namespace Detail::TDF;
+ }
+ }
+ #pragma clang module end
+
+ // TDFInterface
+ #pragma clang module begin M.TDFInterface
+ #pragma clang module import M.TDFNodes
+ namespace Internal {
+ namespace TDF {
+ using namespace Detail::TDF;
+ }
+ }
+ #pragma clang module end
+
+#pragma clang module endbuild
+
+#pragma clang module import M.TDFNodes
+namespace Internal {
+ namespace TDF {
+ TLoopManager * use;
+ }
+}
OpenPOWER on IntegriCloud