[clang-tools-extra] r251265 - assert(false) -> llvm_unreachable.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 25 21:55:12 PDT 2015


On Oct 25, 2015 3:05 PM, "Benjamin Kramer via cfe-commits" <
cfe-commits at lists.llvm.org> wrote:
>
> Author: d0k
> Date: Sun Oct 25 17:03:00 2015
> New Revision: 251265
>
> URL: http://llvm.org/viewvc/llvm-project?rev=251265&view=rev
> Log:
> assert(false) -> llvm_unreachable.
>
> Modified:
>
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
>
> Modified:
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
> URL:
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp?rev=251265&r1=251264&r2=251265&view=diff
>
==============================================================================
> ---
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
(original)
> +++
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
Sun Oct 25 17:03:00 2015
> @@ -82,7 +82,7 @@ getZeroLiteralToCompareWithForGivenType(
>      return Context.getLangOpts().CPlusPlus11 ? "nullptr" : "0";
>
>    default:
> -    assert(false && "Unexpected cast kind");
> +    llvm_unreachable("Unexpected cast kind");
>    }
>    return "";

I think you can drop the return here, then?

>  }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151025/cb5c1167/attachment.html>


More information about the cfe-commits mailing list