[PATCH] D119184: [clang] [concepts] Check constrained-auto return types for void-returning functions

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 17 08:48:47 PST 2022


Quuxplusone added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:3766
+                                            Expr *&RetExpr, const AutoType *AT,
+                                            bool HasReturnStmt) {
+  // If this is the conversion function for a lambda, we choose to deduce its
----------------
rsmith wrote:
> It looks like you ended up not using the new parameter for anything. Did you intend to / do you still need it?
Huh, I guess I don't need it anymore.
Btw, does it make sense that I marked `AT` as `const AutoType *`? Initially I'd been worried that something on this codepath might be stashing state inside `*AT`, or otherwise updating it to say "This was //written// `auto&`, but now //refers// to the type <foo>." This week, I'm not sure why I would have ever suspected that.
But still, this codepath //does// update the state of `*FD`, so the fact that it doesn't update `*AT` is still somewhat worthy of note...
Anyway, if the `const` is uncontroversial, I could just land that `const` in its own commit to shrink this PR a tiny bit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119184



More information about the cfe-commits mailing list