<div dir="ltr">Very much so. Also nice all_of use! I'd have never thought about that :)<div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 11, 2020 at 7:03 PM David Blaikie via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 11, 2020 at 12:21 AM Haojian Wu via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Haojian Wu<br>
Date: 2020-05-11T09:20:48+02:00<br>
New Revision: d82538b3f691f3ba1cb7a945a5f8594f71816fdf<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf.diff</a><br>
<br>
LOG: Fix -Wunused compiler warning.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
clang/lib/AST/Expr.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp<br>
index 2a0e0425ef1f..8b327300fb2d 100644<br>
--- a/clang/lib/AST/Expr.cpp<br>
+++ b/clang/lib/AST/Expr.cpp<br>
@@ -4686,8 +4686,10 @@ RecoveryExpr::RecoveryExpr(ASTContext &Ctx, QualType T, SourceLocation BeginLoc,<br>
: Expr(RecoveryExprClass, T, VK_LValue, OK_Ordinary), BeginLoc(BeginLoc),<br>
EndLoc(EndLoc), NumExprs(SubExprs.size()) {<br>
assert(!T.isNull());<br>
+#ifndef NDEBUG // avoid -Wunused warnings.<br>
for (auto *E : SubExprs)<br>
assert(E != nullptr);<br>
+#endif<br></blockquote><div><br>This might be better written as:<br><br>assert(llvm::all_of(SubExprs, [](Expr* E) { return E != nullptr; }));<br><br>& probably include some kind of message (... && "message") about this precondition.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
llvm::copy(SubExprs, getTrailingObjects<Expr *>());<br>
setDependence(computeDependence(this));<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>