summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DelayedDiagnostic.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
commitd39e5f14636bec2ef3164c12d80fbd40ad36e88f (patch)
treeece3c2b5fc5acc70cb80ea27d09ce3820061432e /clang/lib/Sema/DelayedDiagnostic.cpp
parentdd8638fb3e172da32e0ed3e30ac80535b40c054e (diff)
downloadbcm5719-llvm-d39e5f14636bec2ef3164c12d80fbd40ad36e88f.tar.gz
bcm5719-llvm-d39e5f14636bec2ef3164c12d80fbd40ad36e88f.zip
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) llvm-svn: 159591
Diffstat (limited to 'clang/lib/Sema/DelayedDiagnostic.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud