https://llvm.org/bugs/show_bug.cgi?id=26535
Bug ID: 26535 Summary: "tautological-undefined-compare" warning is not fired when dereferrenced null pointer is casted back to pointer Product: new-bugs Version: 3.6 Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: dmi...@dali-studio.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Here's a sample snippet: int& get() { return *reinterpret_cast<int*>(0); // this code is UB } void test() { int* foo = &(get()); if (foo == nullptr) { // silently optimized away, no warnings } } This broke existing code while migrating from 3.4 to 3.6 (Android NDK). Yes, the above code is UB, so a warning would be nice. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs