HomePhabricator

[clang] don't mark as Elidable CXXConstruct expressions used in NRVO

Authored by mizvekov on Sep 14 2021, 4:46 PM.

Description

[clang] don't mark as Elidable CXXConstruct expressions used in NRVO

See PR51862.

The consumers of the Elidable flag in CXXConstructExpr assume that
an elidable construction just goes through a single copy/move construction,
so that the source object is immediately passed as an argument and is the same
type as the parameter itself.

With the implementation of P2266 and after some adjustments to the
implementation of P1825, we started (correctly, as per standard)
allowing more cases where the copy initialization goes through
user defined conversions.

With this patch we stop using this flag in NRVO contexts, to preserve code
that relies on that assumption.
This causes no known functional changes, we just stop firing some asserts
in a cople of included test cases.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D109800

Details

Committed
mizvekovSep 21 2021, 12:41 PM
Reviewer
rsmith
Differential Revision
D109800: [clang] don't mark as Elidable CXXConstruct expressions used in NRVO
Parents
rG33e1713a00a5: [Bazel] Add support for targeting macOS arm64
Branches
Unknown
Tags
Unknown