aboutsummaryrefslogtreecommitdiff
path: root/test/Modules/namespaces.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-09 17:38:47 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-09 17:38:47 +0000
commit0fdc09fe680787b855cf20183c4bd3b83f2c907f (patch)
treed0b4b5a3084439d53d910b4536bcc6f9c10e0522 /test/Modules/namespaces.cpp
parentc6c8e0ec96bb64f1b9f543d7c8317c6090f80a30 (diff)
Implement merging of namespace-scope declarations across modules, so
that we can merge, for example, two occurrences of namespace N { void f(); } in two disjoint modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/namespaces.cpp')
-rw-r--r--test/Modules/namespaces.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp
index e1a8d6e8b0..9ef966ac01 100644
--- a/test/Modules/namespaces.cpp
+++ b/test/Modules/namespaces.cpp
@@ -5,6 +5,8 @@ namespace N6 {
char &f(char);
}
+namespace N8 { }
+
@import namespaces_left;
@import namespaces_right;
@@ -23,6 +25,10 @@ namespace N5 {
char &f(char);
}
+namespace N10 {
+ int &f(int);
+}
+
void testMerged() {
int &ir1 = N5::f(17);
int &ir2 = N6::f(17);
@@ -34,3 +40,10 @@ void testMerged() {
char &cr2 = N6::f('b');
}
+// Test merging of declarations within namespaces that themselves were
+// merged without a common first declaration.
+void testMergedMerged() {
+ int &ir1 = N8::f(17);
+ int &ir2 = N9::f(17);
+ int &ir3 = N10::f(17);
+}