[PATCH] D99005: [clang] Implement P2266 Simpler implicit move
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 28 23:37:41 PDT 2021
rjmccall added inline comments.
================
Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1059
+ else if (auto *F = dyn_cast<BlockDecl>(DC))
+ goto unimplemented; // FIXME: get the return type here somehow...
+ else
----------------
mizvekov wrote:
> @rjmccall Hello! Do you have any tips for fixing this one?
I've always found it annoying that we only store the block type on the `BlockExpr` and not the `BlockDecl`, so if you've got a good reason to change that, I'm not opposed.
That said, while I'm not an expert in how we do NRVO variable tracking, the code must have some ability to handle an unknown return type when just processing declarations by delaying some of the bookkeeping/analysis until the end of the function. It's possible but quite uncommon to declare a return type explicitly in a block, so that's the dominant case here. I'm actually surprised we do any of this tracking when we're just instantiating a variable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99005/new/
https://reviews.llvm.org/D99005
More information about the cfe-commits
mailing list