summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2012-11-26 08:55:48 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2012-11-26 08:55:48 +0000
commit09848e709cea60fa4081f34d888e0265fad09055 (patch)
tree69a59461963666ab6ff782cfc2d51bf9f48dfb35 /clang
parentdd2ca571ae371469ffaaa898920572d34c1baa0a (diff)
downloadbcm5719-llvm-09848e709cea60fa4081f34d888e0265fad09055.tar.gz
bcm5719-llvm-09848e709cea60fa4081f34d888e0265fad09055.zip
Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoft
llvm-svn: 168583
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp2
-rw-r--r--clang/test/CodeGenCXX/mangle-ms.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 7a12c4da951..d91f5125387 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -453,7 +453,7 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
if (const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(ND)) {
if (NS->isAnonymousNamespace()) {
- Out << "?A";
+ Out << "?A@";
break;
}
}
diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp
index 0edb4b4339a..6441d67a758 100644
--- a/clang/test/CodeGenCXX/mangle-ms.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms.cpp
@@ -3,6 +3,7 @@
// CHECK: @"\01?a@@3HA"
// CHECK: @"\01?b@N@@3HA"
+// CHECK: @"\01?anonymous@?A@N@@3HA"
// CHECK: @c
// CHECK: @"\01?d@foo@@0FB"
// CHECK: @"\01?e@foo@@1JC"
@@ -24,10 +25,16 @@
int a;
-namespace N { int b; }
+namespace N {
+ int b;
+
+ namespace {
+ int anonymous;
+ }
+}
static int c;
-int _c(void) {return c;}
+int _c(void) {return N::anonymous + c;}
// CHECK: @"\01?_c@@YAHXZ"
class foo {
OpenPOWER on IntegriCloud