// We don't do anything special if this isn't an unsigned integral
// comparison: we're only interested in integral comparisons, and
// signed comparisons only happen in cases we don't care to warn about.
- if (!T->hasUnsignedIntegerRepresentation())
+ //
+ // We also don't care about value-dependent expressions or expressions
+ // whose result is a constant.
+ if (!T->hasUnsignedIntegerRepresentation()
+ || E->isValueDependent() || E->isIntegerConstantExpr(S.Context))
return AnalyzeImpConvsInComparison(S, E);
Expr *lex = E->getLHS()->IgnoreParenImpCasts();
// This one entered into an infinite loop.
template <unsigned long N>
void rdar8520617() {
- if (N > 1) { } // expected-warning {{comparison of 0 > unsigned expression is always false}}
+ if (N > 1) { }
}
int f2() {
- rdar8520617<0>(); // expected-note {{in instantiation}}
+ rdar8520617<0>();
}