[clang-tools-extra] r251262 - [clang-tidy] Add return value for non-assert builds.

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


On Oct 25, 2015 2:47 PM, "Daniel Jasper via cfe-commits" <
cfe-commits at lists.llvm.org> wrote:
>
> Author: djasper
> Date: Sun Oct 25 16:44:55 2015
> New Revision: 251262
>
> URL: http://llvm.org/viewvc/llvm-project?rev=251262&view=rev
> Log:
> [clang-tidy] Add return value for non-assert builds.
>
> 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=251262&r1=251261&r2=251262&view=diff
>
==============================================================================
> ---
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
(original)
> +++
clang-tools-extra/trunk/clang-tidy/readability/ImplicitBoolCastCheck.cpp
Sun Oct 25 16:44:55 2015
> @@ -84,6 +84,7 @@ getZeroLiteralToCompareWithForGivenType(
>    default:
>      assert(false && "Unexpected cast kind");

Prefer llvm_unreachable over assert(false) and the return shouldn't be
needed. (He unreachable will amount to a call to a noreturn function in
both asserts and non-asserts builds)

>    }
> +  return "";
>  }
>
>  bool isUnaryLogicalNotOperator(const Stmt *Statement) {
>
>
> _______________________________________________
> 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/298f2754/attachment.html>


More information about the cfe-commits mailing list