Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

chained comparisons lacking warning gcc has #8364

Open Quuxplusone opened 14 years ago

Quuxplusone commented 14 years ago
Bugzilla Link PR7975
Status NEW
Importance P normal
Reported by Evan Martin (evan@chromium.org)
Reported on 2010-08-23 14:26:51 -0700
Last modified on 2017-09-18 16:32:50 -0700
Version trunk
Hardware PC Linux
CC dgregor@apple.com, llvm-bugs@lists.llvm.org, rjmccall@apple.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

We were just marveling at the gcc warning on the following code:

bool x = 3 < 4 < 5;

test.cc:3: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning

So I thought to see what clang thinks of it. No warning at all!

(llvm/clang r111814)

Quuxplusone commented 14 years ago

This would be a great warning to have.