]> granicus.if.org Git - clang/commit
Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer...
authorSteve Naroff <snaroff@apple.com>
Thu, 18 Oct 2007 05:13:08 +0000 (05:13 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 18 Oct 2007 05:13:08 +0000 (05:13 +0000)
commitd4dd30ff212acdc11c79b026c97cc72d7d89f565
tree0bab2a28e0d94d7d232ef7a4e034cdc3932c2dd2
parent27b837c3b884b27279f7550361ef73b9896c7510
Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer constants, we need to promote the null pointer constant (which is an integer) to the pointer type. Test case is self explanatory.

This surfaced yesterday, when compiling test/Sema/cocoa.m on Leopard. Since this has nothing to do with ObjC, it's kind of bizarre this hasn't shown up before. I imagine Cocoa.h on Leopard may have changed recently?

Thanks to Ted for localizing the bug and giving me a useful AST dump...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43114 91177308-0d34-0410-b5e6-96231b3b80d8
Sema/SemaExpr.cpp
test/Sema/implicit-cast.c [new file with mode: 0644]