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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to