Commit Graph

7 Commits

Author SHA1 Message Date
Manman Ren d71ad3f744 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 16:28:28 +00:00
Douglas Gregor abde2c7f2c <rdar://problem/13459871> Allow forward declaration of enums with a fixed underlying type in Objective-C (as well as C++11).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177930 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 22:22:35 +00:00
Eli Friedman 2fcff83aa4 The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)

<rdar://problem/12857117>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170402 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18 02:37:32 +00:00
Andy Gibbs 8e8fb3be5b Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19 12:44:48 +00:00
Eli Friedman 04ca252762 Fix a couple of nasty bugs involving negative enum constants. <rdar://problem/10760113>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149965 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 04:34:38 +00:00
Douglas Gregor 69ff26bd1e The integer type of an enumeration type isn't always canonical
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139334 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-08 23:29:05 +00:00
Douglas Gregor 5471bc85b6 Allow C++0x enumerations with a fixed underlying type in
Objective-C. The @encode'ing of such an enumeration type is the same
as its underlying type. <rdar://problem/5276348>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139297 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-08 17:18:35 +00:00