summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/compare.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-07-21 02:46:28 +0000
committerRichard Trieu <rtrieu@google.com>2011-07-21 02:46:28 +0000
commitbb43dec25579c10090b7eecfdfedc4d4f442e6af (patch)
tree93a746a46ecb65a919601cec5e70be926d791ed4 /clang/test/SemaCXX/compare.cpp
parent178fb406129f0f54bf379548527ad5cbd7a2f79d (diff)
downloadbcm5719-llvm-bb43dec25579c10090b7eecfdfedc4d4f442e6af.tar.gz
bcm5719-llvm-bb43dec25579c10090b7eecfdfedc4d4f442e6af.zip
Remove warning for conditional operands of differend signedness from -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion.
llvm-svn: 135664
Diffstat (limited to 'clang/test/SemaCXX/compare.cpp')
-rw-r--r--clang/test/SemaCXX/compare.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/compare.cpp b/clang/test/SemaCXX/compare.cpp
index ca8af2186f7..28e2dd0ad51 100644
--- a/clang/test/SemaCXX/compare.cpp
+++ b/clang/test/SemaCXX/compare.cpp
@@ -212,3 +212,14 @@ static const unsigned int kMax = 0;
int pr7536() {
return (kMax > 0);
}
+
+// -Wsign-compare should not warn when ?: operands have different signedness.
+// This will be caught by -Wsign-conversion
+void test3() {
+ unsigned long a;
+ signed long b;
+ (void) (true ? a : b);
+ (void) (true ? (unsigned int)a : (signed int)b);
+ (void) (true ? b : a);
+ (void) (true ? (unsigned char)b : (signed char)a);
+}
OpenPOWER on IntegriCloud