aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-07-02 21:19:23 +0000
committerJordan Rose <jordan_rose@apple.com>2012-07-02 21:19:23 +0000
commit7dd900ed308506f9cf1cb72c70db1652f94cab37 (patch)
tree3dc75707934b1fab99a0a36e62e3d312c7ae1bfb /lib/StaticAnalyzer/Core/ExprEngine.cpp
parentb135f0f2d893121ed2cc46d4d6c5bd5ab87d872f (diff)
In blocks, only pretend that enum constants have enum type if necessary.
In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) Thus, when a block's return type is inferred from an enum constant, it is incompatible with expressions that return the enum type. In r158899, I told block returns to pretend that enum constants have enum type, like in C++. Doug Gregor pointed out that this can break existing code. Now, we don't check the types of return statements until the end of the block. This lets us go back and add implicit casts in blocks with mixed enum constants and enum-typed expressions. <rdar://problem/11662489> (again) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
0 files changed, 0 insertions, 0 deletions