Movatterモバイル変換


[0]ホーム

URL:


Issue 2347 - WG21 CWG Issues
Title
Passing short scoped enumerations to ellipsis
Status
c++20
Section
7.6.1.3 [expr.call]
Submitter
Mike Miller

Created on2017-04-28.00:00:00 last changed62 months ago

Messages

msg6439 (view)
Date: 2019-10-15.00:00:00

Proposed resolution (October, 2019):

Change 7.6.1.3 [expr.call] paragraph 12 as follows:

...Passing a potentially-evaluated argument ofa scopedenumeration type or of a class type (Clause 11 [class]) having an eligible non-trivial copyconstructor, an eligible non-trivial move constructor, or anon-trivial destructor (11.4.4 [special]), withno corresponding parameter, is conditionally-supported withimplementation-defined semantics. If the argument...
msg6438 (view)
Date: 2019-09-15.00:00:00

Notes from the September, 2019 teleconference:

The consensus was that passing scoped enumerations to ellipsisshould be conditionally-supported behavior, similar to thetreatment of class types with nontrivial copy semantics.

msg6437 (view)
Date: 2019-05-15.00:00:00

Proposed resolution (May, 2019): [SUPERSEDED]

Change 7.6.1.3 [expr.call] paragraph 12 as follows:

...If the argument hasanintegral or enumeration type that issubject to the integral promotions(7.3.7 [conv.prom]),a scoped enumeration typewhose underlying type is subject to the integral promotions,or a floating-point type thatis subject to the floating-point promotion(7.3.8 [conv.fpprom]), the value of the argument isconverted to the promoted type before the call. Thesepromotions are referred to as thedefault argumentpromotions.
msg6436 (view)
Date: 2018-06-15.00:00:00

Notes from the June, 2018 meeting:

The consensus of CWG was that the value passed ougnt to be widenedto match the promoted type of the underlying type.

msg5927 (view)
Date: 2019-11-15.00:00:00

[Adopted as a DR at the November, 2019 meeting.]

According to 7.6.1.3 [expr.call] paragraph 9,

If the argument has integral or enumeration type that is subject to theintegral promotions (7.3.7 [conv.prom]), or a floating-point typethat is subject to the floating-point promotion (7.3.8 [conv.fpprom]),the value of the argument is converted to the promoted type before thecall. These promotions are referred to as the default argument promotions.

A scoped enumeration with an underlying type that is shorter thanint will not be widened when passed to an ellipsis. Should itbe?

History
DateUserActionArgs
2020-12-15 00:00:00adminsetmessages: +msg6439
2020-12-15 00:00:00adminsetmessages: +msg6438
2020-12-15 00:00:00adminsetmessages: +msg6437
2020-12-15 00:00:00adminsetmessages: +msg6436
2020-12-15 00:00:00adminsetstatus: open -> c++20
2017-04-28 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp