[all-commits] [llvm/llvm-project] 96a5cf: [AST][RecoveryExpr] Fix the value category for rec...

Haojian Wu via All-commits all-commits at lists.llvm.org
Wed Jul 8 04:55:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 96a5cfff208d8e86a598e64412d9ef5dde0f9c9e
      https://github.com/llvm/llvm-project/commit/96a5cfff208d8e86a598e64412d9ef5dde0f9c9e
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2020-07-08 (Wed, 08 Jul 2020)

  Changed paths:
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ExprClassification.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/AST/ast-dump-recovery.cpp
    M clang/test/SemaCXX/recovery-expr-type.cpp

  Log Message:
  -----------
  [AST][RecoveryExpr] Fix the value category for recovery expr.

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.

Differential revision: https://reviews.llvm.org/D83201




More information about the All-commits mailing list