[cfe-commits] r86265 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td lib/Sema/SemaExpr.cpp
John McCall
rjmccall at apple.com
Fri Nov 6 10:16:06 PST 2009
Author: rjmccall
Date: Fri Nov 6 12:16:06 2009
New Revision: 86265
URL: http://llvm.org/viewvc/llvm-project?rev=86265&view=rev
Log:
Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=86265&r1=86264&r2=86265&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Fri Nov 6 12:16:06 2009
@@ -160,6 +160,6 @@
def : DiagGroup<"endif-labels", [ExtraTokens]>; // endif-labels = endif-tokens
// A warning group for warnings that we want to have on by default in clang,
-// but which aren't no by default in GCC.
+// but which aren't on by default in GCC.
def NonGCC : DiagGroup<"non-gcc",
[SignCompare]>;
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=86265&r1=86264&r2=86265&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Nov 6 12:16:06 2009
@@ -4454,6 +4454,10 @@
/// suppresses the warning in some cases
void Sema::CheckSignCompare(Expr *lex, Expr *rex, SourceLocation OpLoc,
const PartialDiagnostic &PD, bool Equality) {
+ // Don't warn if we're in an unevaluated context.
+ if (ExprEvalContext == Unevaluated)
+ return;
+
QualType lt = lex->getType(), rt = rex->getType();
// Only warn if both operands are integral.
More information about the cfe-commits
mailing list