[PATCH] D136457: [clang][Interp] Fix discarding non-primitive function call return values

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 00:39:13 PDT 2022


tbaeder marked an inline comment as done.
tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1158
+
+    if (DiscardResult && !T) {
+      // If we need to discard the return value but the function returns its
----------------
shafik wrote:
> Could you alternatively use `Func->hasRVO()`? 
I don't have to, but now that you mentioned it, that's much better since we won' t allocate the local for void return types... thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136457/new/

https://reviews.llvm.org/D136457



More information about the cfe-commits mailing list