[PATCH] D83201: [AST][RecoveryExpr] Fix the value category for recovery expr.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 12:53:28 PDT 2020


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a project: clang.

RecoveryExpr was always lvalue, but it is wrong if we use it to model
broken function calls, function call expression has more compliated rules:

- a call to a function whose return type is an lvalue reference yields an lvalue;
- a call to a function whose return type is an rvalue reference yields an xvalue;
- a call to a function whose return type is nonreference type yields a prvalue;

This patch makes the recovery-expr align with the function call if it is
modeled a broken call.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83201

Files:
  clang/include/clang/AST/Expr.h
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/Expr.cpp
  clang/lib/AST/ExprClassification.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/test/AST/ast-dump-recovery.cpp
  clang/test/SemaCXX/recovery-expr-type.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83201.275615.patch
Type: text/x-patch
Size: 8845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200706/48927d30/attachment.bin>


More information about the cfe-commits mailing list