[cfe-commits] r72901 - /cfe/trunk/lib/Sema/SemaDecl.cpp
Eli Friedman
eli.friedman at gmail.com
Thu Jun 4 16:03:07 PDT 2009
Author: efriedma
Date: Thu Jun 4 18:03:07 2009
New Revision: 72901
URL: http://llvm.org/viewvc/llvm-project?rev=72901&view=rev
Log:
Fix up this compatibility hack to be more compatible with gcc.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=72901&r1=72900&r2=72901&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Jun 4 18:03:07 2009
@@ -575,10 +575,11 @@
// 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)
More information about the cfe-commits
mailing list