]> granicus.if.org Git - clang/commitdiff
Fix up this compatibility hack to be more compatible with gcc.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 4 Jun 2009 23:03:07 +0000 (23:03 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 4 Jun 2009 23:03:07 +0000 (23:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72901 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 959154c4ec1b55114851508321c6e2f08a477e12..a39ff47cdbe83e569560b2960bc21f1e428d19e0 100644 (file)
@@ -575,10 +575,11 @@ void Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
 
   // If we have a redefinition of a typedef in C, emit a warning.  This warning
   // is normally mapped to an error, but can be controlled with
-  // -Wtypedef-redefinition.  If either the original was in a system header,
-  // don't emit this for compatibility with GCC.
+  // -Wtypedef-redefinition.  If either the original or the redefinition is
+  // in a system header, don't emit this for compatibility with GCC.
   if (PP.getDiagnostics().getSuppressSystemWarnings() &&
-      Context.getSourceManager().isInSystemHeader(Old->getLocation()))
+      (Context.getSourceManager().isInSystemHeader(Old->getLocation()) ||
+       Context.getSourceManager().isInSystemHeader(New->getLocation())))
     return;
   
   Diag(New->getLocation(), diag::warn_redefinition_of_typedef)