]> granicus.if.org Git - clang/commitdiff
Fix the ASTImporter's lookup for anonymous structs/unions that get a
authorDouglas Gregor <dgregor@apple.com>
Thu, 22 Sep 2011 17:51:56 +0000 (17:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 22 Sep 2011 17:51:56 +0000 (17:51 +0000)
linkage name via typedef. Patch from/fixes PR10958.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140317 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTImporter.cpp

index 1a2e02fe181b17a2863b1894c4ec7bb74028228f..c791ba1a58a1788bc30755c3b148e5ec62c8f727 100644 (file)
@@ -2178,7 +2178,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
   // We may already have an enum of the same name; try to find and match it.
   if (!DC->isFunctionOrMethod() && SearchName) {
     SmallVector<NamedDecl *, 4> ConflictingDecls;
-    for (DeclContext::lookup_result Lookup = DC->lookup(Name);
+    for (DeclContext::lookup_result Lookup = DC->lookup(SearchName);
          Lookup.first != Lookup.second; 
          ++Lookup.first) {
       if (!(*Lookup.first)->isInIdentifierNamespace(IDNS))
@@ -2264,7 +2264,7 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) {
   RecordDecl *AdoptDecl = 0;
   if (!DC->isFunctionOrMethod() && SearchName) {
     SmallVector<NamedDecl *, 4> ConflictingDecls;
-    for (DeclContext::lookup_result Lookup = DC->lookup(Name);
+    for (DeclContext::lookup_result Lookup = DC->lookup(SearchName);
          Lookup.first != Lookup.second; 
          ++Lookup.first) {
       if (!(*Lookup.first)->isInIdentifierNamespace(IDNS))