Created on 2013-01-31.00:00:00 last changed 121 months ago
[Moved to DR at the February, 2014 meeting.]
Proposed resolution (September, 2013):
Change 7.5.6 [expr.prim.lambda] paragraph 15 as follows:
...An array of runtime bound (9.3.4.5 [dcl.array]) or a member of an anonymous union shall not be captured by copy.
Change 7.5.6 [expr.prim.lambda] paragraph 16 as follows:
...It is unspecified whether additional unnamed non-static data members are declared in the closure type for entities captured by reference. A member of an anonymous union shall not be captured by reference. [Note:...
Notes from the April, 2013 meeting:
CWG decided that an attempt to capture a member of an anonymous union should be ill-formed.
It is not clear from the description of capturing in 7.5.6 [expr.prim.lambda] whether an implicit capture resulting from the odr-use of a member of an anonymous union captures that member or the anonymous union, and there is implementation divergence. For example,
int main() { static int result; struct A { int x; }; struct B { int y; }; union { A a; B b; }; a.x = 1; [=]() mutable { a.x = 2; result = b.y; }(); if (result == 1) return 0; throw 0; }
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-11-24 00:00:00 | admin | set | status: dr -> c++14 |
2014-03-03 00:00:00 | admin | set | messages: + msg4936 |
2014-03-03 00:00:00 | admin | set | status: ready -> dr |
2013-10-14 00:00:00 | admin | set | messages: + msg4573 |
2013-10-14 00:00:00 | admin | set | status: drafting -> ready |
2013-05-03 00:00:00 | admin | set | messages: + msg4330 |
2013-05-03 00:00:00 | admin | set | status: open -> drafting |
2013-01-31 00:00:00 | admin | create |