summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp7
-rw-r--r--clang/test/Sema/compare.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 979a6464424..002c985e0c5 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3952,9 +3952,10 @@ static void AnalyzeComparison(Sema &S, BinaryOperator *E) {
return;
}
- S.Diag(E->getOperatorLoc(), diag::warn_mixed_sign_comparison)
- << LHS->getType() << RHS->getType()
- << LHS->getSourceRange() << RHS->getSourceRange();
+ S.DiagRuntimeBehavior(E->getOperatorLoc(), E,
+ S.PDiag(diag::warn_mixed_sign_comparison)
+ << LHS->getType() << RHS->getType()
+ << LHS->getSourceRange() << RHS->getSourceRange());
}
/// Analyzes an attempt to assign the given value to a bitfield.
diff --git a/clang/test/Sema/compare.c b/clang/test/Sema/compare.c
index 03aebb3a046..406ade81aa0 100644
--- a/clang/test/Sema/compare.c
+++ b/clang/test/Sema/compare.c
@@ -333,3 +333,10 @@ struct test11S { unsigned x : 30; };
int test11(unsigned y, struct test11S *p) {
return y > (p->x >> 24); // no-warning
}
+
+typedef char one_char[1];
+typedef char two_chars[2];
+
+void test12(unsigned a) {
+ if (0 && -1 > a) { }
+}
OpenPOWER on IntegriCloud