- Title
- C-style cast in braced-init-list assignment
- Status
- cd3
- Section
- 7.6.19 [expr.assign]
- Submitter
- Daniel Krügler
Created on 2012-08-14.00:00:00 last changed 152 months ago
Messages
Date: 2013-04-15.00:00:00
[Moved to DR at the April, 2013 meeting.]
Date: 2012-10-15.00:00:00
Proposed resolution (October, 2012): Change 7.6.19 [expr.assign] paragraph 9 as follows:
The meaning of x={v} , where T is the scalar type of
the expression x , is that of
x=T(v) except that
no narrowing conversion (9.5.5 [dcl.init.list]) is allowed
x=T{v} . The meaning of x={} is
x=T() x=T{} .
Date: 2026-07-25.21:52:10
According to 7.6.19 [expr.assign] paragraph 9, This definition adds a gratuitous C-style cast to the right-hand
operand, inadvertently allowing such things as base-to-derived
conversions and circumvention of access checking.
The meaning of x={v} , where T is the scalar type of
the expression x , is that of x=T(v) except that no
narrowing conversion (9.5.5 [dcl.init.list]) is allowed. The
meaning of x={} is x=T() .
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
| 2013-10-14 00:00:00 | admin | set | status: dr -> drwp |
| 2013-05-03 00:00:00 | admin | set | messages: + msg4392 |
| 2013-05-03 00:00:00 | admin | set | status: ready -> dr |
| 2012-11-03 00:00:00 | admin | set | messages: + msg4055 |
| 2012-11-03 00:00:00 | admin | set | status: open -> ready |
| 2012-08-14 00:00:00 | admin | create | |