diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-09 18:07:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-09 18:07:24 +0000 |
commit | 1c3875dab92f3b0a25212c80863e452cb269d3f1 (patch) | |
tree | 7aa3c4d982f43b9547ce364c510aad874da690ef /test/Modules/namespaces.cpp | |
parent | 0fdc09fe680787b855cf20183c4bd3b83f2c907f (diff) |
When deserializing an anonymous namespace from a module, do not attach
the anonymous namespace to its parent. Semantically, this means that
the anonymous namespaces defined in one module are distinct from the
anonymous namespaces defined in another module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/namespaces.cpp')
-rw-r--r-- | test/Modules/namespaces.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp index 9ef966ac01..b60f75cff6 100644 --- a/test/Modules/namespaces.cpp +++ b/test/Modules/namespaces.cpp @@ -47,3 +47,14 @@ void testMergedMerged() { int &ir2 = N9::f(17); int &ir3 = N10::f(17); } + +// Test merging when using anonymous namespaces, which does not +// actually perform any merging. +// other file: expected-note{{passing argument to parameter here}} +void testAnonymousNotMerged() { + N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::<anonymous>::Foo *' with an rvalue of type 'N11::<anonymous>::Foo *'}} + N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::<anonymous>::Foo *' with an rvalue of type 'N12::<anonymous>::Foo *'}} +} + + +// other file: expected-note{{passing argument to parameter here}} |