ObjC: Handle boolean fixed type for enum.
authorManman Ren <manman.ren@gmail.com>
Wed, 23 Mar 2016 16:28:28 +0000 (16:28 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 23 Mar 2016 16:28:28 +0000 (16:28 +0000)
commit6d93ad844a5b81e36d67596ffa055f0f3d00d1f5
treedae539a94d8a2e659224d43c1de4b9582742084d
parentb7d30cbc7ec8fbaf21d005468ae6d26f41e3a329
ObjC: Handle boolean fixed type for enum.

Before this commit, we assert failure in ImplicitCastExpr
"unheralded conversion to bool". This commit fixes the assertion by using
the correct cast type when the fixed type is boolean.

This commit also fixes the behavior for Microsoft mode as well, since
Obj-C and Microsoft mode share the same code path.

rdar://24999533

llvm-svn: 264167
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaObjC/enum-fixed-type.m