[cfe-commits] r120376 - /cfe/trunk/lib/AST/Type.cpp

Frits van Bommel fvbommel at gmail.com
Mon Nov 29 23:21:05 PST 2010


On Tue, Nov 30, 2010 at 2:43 AM, John McCall <rjmccall at apple.com> wrote:
> Please use llvm_unreachable and a return 0 instead of adding a default case to a supposedly exhaustive switch.

There should be no need to return 0 after llvm_unreachable. It expands
to a call to an __attribute__((noreturn)) (Or __declspec(noreturn) on
MSVC) function.

I agree about using llvm_unreachable after the switch instead of
"default: assert(0)" though, if all other cases return.



More information about the cfe-commits mailing list