Narrowing conversions to bit-fields
9.4.5 [dcl.init.list]
Richard Corden

Created on 2012-02-08.00:00:00 last changed 125 months ago


Date: 2014-02-15.00:00:00

Rationale (February, 2014):

EWG determined that no action should be taken on this issue.

Date: 2012-10-15.00:00:00

Rationale (October, 2012):

CWG felt that this was more of a language design question and would be better considered by EWG.

Date: 2012-08-15.00:00:00

Additional note (August, 2012):

It was observed that the proposed narrowing error, unlike in other contexts, cannot be circumvented by adding a cast. The only way to avoid a narrowing error would be to avoid using the brace syntax or to mask the value to an appropriate width. Even the latter approach could conceivably require an implementation to track the maximum number of bits needed by operations applied on top of the masked value, unless the masking were required to be at the top level of the initializer expression.

Date: 2012-02-08.00:00:00

The definition of a “narrowing conversion” in 9.4.5 [dcl.init.list] paragraph 7 is couched in terms of the type of the target. A conversion to a too-small bit-field should presumably also be categorized as a narrowing conversion. (See also issue 1449.)

Date User Action Args
2014-03-03 00:00:00adminsetmessages: + msg4978
2014-03-03 00:00:00adminsetstatus: extension -> nad
2012-11-03 00:00:00adminsetmessages: + msg4193
2012-11-03 00:00:00adminsetstatus: open -> extension
2012-09-24 00:00:00adminsetmessages: + msg3953
2012-02-08 00:00:00admincreate