[MS ABI] Ignore transparent contexts when determining the effective context

We didn't skip over extern "C++" contexts, causing us to mangle things
which don't need to be mangled.

llvm-svn: 270089
This commit is contained in:
David Majnemer 2016-05-19 18:15:53 +00:00
parent 0376b1a2d7
commit b0f1dbdf33
2 changed files with 6 additions and 1 deletions

View File

@ -94,7 +94,7 @@ static const DeclContext *getEffectiveDeclContext(const Decl *D) {
return getEffectiveDeclContext(cast<Decl>(DC));
}
return DC;
return DC->getRedeclContext();
}
static const DeclContext *getEffectiveParentContext(const DeclContext *DC) {

View File

@ -4,6 +4,11 @@
int a;
// CHECK-DAG: @"\01?a@@3HA"
extern "C++" {
static int __attribute__((used)) ignore_transparent_context;
// CHECK-DAG: @ignore_transparent_context
}
namespace N {
int b;
// CHECK-DAG: @"\01?b@N@@3HA"