forked from OSchip/llvm-project
Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz. llvm-svn: 86265
This commit is contained in:
parent
68d2417e05
commit
e2c91e6b26
|
@ -160,6 +160,6 @@ def : DiagGroup<"", [Extra]>; // -W = -Wextra
|
|||
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]>;
|
||||
|
|
|
@ -4454,6 +4454,10 @@ QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
|
|||
/// 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.
|
||||
|
|
Loading…
Reference in New Issue