summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-10-23 02:17:46 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-10-23 02:17:46 +0000
commitfd8634a09de716f6de7b6699d6f4287056551525 (patch)
treed600133b3c296a3bd9256b843810c95921b2afd3 /clang/test
parentc89e4ca3c181b907562afa3e88be74366cf65bd2 (diff)
downloadbcm5719-llvm-fd8634a09de716f6de7b6699d6f4287056551525.tar.gz
bcm5719-llvm-fd8634a09de716f6de7b6699d6f4287056551525.zip
Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules. With this fixed, I no longer see any test regressions in the libc++ test suite when enabling a single-module module.map for libc++ (other than issues with my system headers). llvm-svn: 193219
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/module.map5
-rw-r--r--clang/test/Modules/Inputs/using-decl-a.h10
-rw-r--r--clang/test/Modules/Inputs/using-decl-b.h11
-rw-r--r--clang/test/Modules/using-decl.cpp8
4 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index 12da7a649ad..cb4d339f7e4 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -258,3 +258,8 @@ module warning {
module initializer_list {
header "initializer_list"
}
+
+module using_decl {
+ module a { header "using-decl-a.h" export * }
+ module b { header "using-decl-b.h" export * }
+}
diff --git a/clang/test/Modules/Inputs/using-decl-a.h b/clang/test/Modules/Inputs/using-decl-a.h
new file mode 100644
index 00000000000..85a4788e764
--- /dev/null
+++ b/clang/test/Modules/Inputs/using-decl-a.h
@@ -0,0 +1,10 @@
+typedef int using_decl_type;
+int using_decl_var;
+
+namespace UsingDecl {
+ using ::using_decl_type;
+ using ::using_decl_var;
+
+ namespace A { typedef int inner; }
+ using A::inner;
+}
diff --git a/clang/test/Modules/Inputs/using-decl-b.h b/clang/test/Modules/Inputs/using-decl-b.h
new file mode 100644
index 00000000000..b82526f39ff
--- /dev/null
+++ b/clang/test/Modules/Inputs/using-decl-b.h
@@ -0,0 +1,11 @@
+namespace UsingDecl {
+ namespace B { typedef int inner; }
+ using B::inner;
+}
+
+#include "using-decl-a.h"
+
+namespace UsingDecl {
+ using ::using_decl_type;
+ using ::using_decl_var;
+}
diff --git a/clang/test/Modules/using-decl.cpp b/clang/test/Modules/using-decl.cpp
new file mode 100644
index 00000000000..4432738f060
--- /dev/null
+++ b/clang/test/Modules/using-decl.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify
+
+@import using_decl.a;
+
+// expected-no-diagnostics
+UsingDecl::using_decl_type x = UsingDecl::using_decl_var;
+UsingDecl::inner y = x;
OpenPOWER on IntegriCloud