Created on 2005-04-14.00:00:00 last changed 18 months ago
Rationale (2023-05-12)
This is an extension whose detailed specification requires a paper targeted at EWG. Some implementations warn about the situation in question.
Note (February, 2006):
Recent discussions have suggested that undefined behavior be reduced. One possibility (broadening the scope of this issue to include object declarations as well as references) was to require a diagnostic if the initializer uses the value, but not just the address, of the object or reference being declared:
int i = i; // Ill-formed, diagnostic required void* p = &p; // Okay
Rationale (October, 2005):
The CWG felt that this error was not likely to arise very often in practice. Implementations can warn about such constructs, and the resolution for issue 453 makes executing such code undefined behavior; that seemed to address the situation adequately.
Split off from issue 453.
It is in general not possible to determine at compile time whether a reference is used before it is initialized. Nevertheless, there is some sentiment to require a diagnostic in the obvious cases that can be detected at compile time, such as the name of a reference appearing in its own initializer. The resolution of issue 453 originally made such uses ill-formed, but the CWG decided that this question should be a separate issue.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-05-12 20:59:33 | admin | set | messages: + msg7282 |
2023-05-12 20:59:33 | admin | set | status: open -> nad |
2006-02-24 00:00:00 | admin | set | messages: + msg1314 |
2006-02-24 00:00:00 | admin | set | status: nad -> open |
2005-10-22 00:00:00 | admin | set | messages: + msg1289 |
2005-10-22 00:00:00 | admin | set | status: open -> nad |
2005-04-14 00:00:00 | admin | create |