This revision was automatically updated to reflect the committed changes.
Closed by commit rL303325: Fix an assertion failure in 
FormatASTNodeDiagnosticArgument. (authored by alexfh).

Changed prior to commit:
  https://reviews.llvm.org/D33207?vs=99112&id=99386#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33207

Files:
  cfe/trunk/lib/Sema/SemaDecl.cpp
  cfe/trunk/test/SemaCXX/warn-shadow.cpp


Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -6935,7 +6935,7 @@
         }
     }
 
-  DeclContext *OldDC = ShadowedDecl->getDeclContext();
+  DeclContext *OldDC = ShadowedDecl->getDeclContext()->getRedeclContext();
 
   unsigned WarningDiag = diag::warn_decl_shadow;
   SourceLocation CaptureLoc;
Index: cfe/trunk/test/SemaCXX/warn-shadow.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/warn-shadow.cpp
+++ cfe/trunk/test/SemaCXX/warn-shadow.cpp
@@ -206,3 +206,10 @@
 }
 
 }
+
+extern "C" {
+typedef int externC; // expected-note {{previous declaration is here}}
+}
+void handleLinkageSpec() {
+  typedef void externC; // expected-warning {{declaration shadows a typedef in 
the global namespace}}
+}


Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -6935,7 +6935,7 @@
         }
     }
 
-  DeclContext *OldDC = ShadowedDecl->getDeclContext();
+  DeclContext *OldDC = ShadowedDecl->getDeclContext()->getRedeclContext();
 
   unsigned WarningDiag = diag::warn_decl_shadow;
   SourceLocation CaptureLoc;
Index: cfe/trunk/test/SemaCXX/warn-shadow.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/warn-shadow.cpp
+++ cfe/trunk/test/SemaCXX/warn-shadow.cpp
@@ -206,3 +206,10 @@
 }
 
 }
+
+extern "C" {
+typedef int externC; // expected-note {{previous declaration is here}}
+}
+void handleLinkageSpec() {
+  typedef void externC; // expected-warning {{declaration shadows a typedef in the global namespace}}
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to