[PATCH] D92211: [clang] Improve diagnostics for auto-return-type function if the return expr contains expr.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 02:16:41 PST 2020


hokein added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:3306
 StmtResult
 Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
   // If this is the first return we've seen, infer the return type.
----------------
sammccall wrote:
> This seems to only handle lambdas (and blocks).
> Is there a corresponding fix needed for C++14 `auto x() { ... }` ?
oh, right, thanks! The C++14 auo function is in a separate code path, fixed. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92211



More information about the cfe-commits mailing list