HomePhabricator

Reject attempts to call non-static member functions on objects outside

Description

Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

Details

Committed
rsmithMay 10 2019, 7:00 PM
Parents
rL360498: [MSP430] Move InstPrinter files to MCTargetDesc. NFC
Branches
Unknown
Tags
Unknown
Reverted By
rL360531: Revert rL360499 and rL360464 from cfe/trunk: