Created on 2005-01-19.00:00:00 last changed 179 months ago
[Voted into the WP at the March, 2009 meeting.]
Proposed resolution (October, 2006)
Change 14.2 [except.throw] paragraph 3 as indicated:
...The type of the throw-expression shall notIf the type of the exception object would be an incomplete type, or a pointer to an incomplete type other than (possibly cv-qualified) void the program is ill-formed...
Notes from the April, 2005 meeting:
The CWG agreed that the example should be permitted. Note that the reference to throw-expression in the cited text is incorrect; a throw-expression includes the throw keyword and is always of type void. This wording problem is addressed in the proposed resolution for issue 475.
According to 14.2 [except.throw] paragraph 3,
The type of the throw-expression shall not be an incomplete type, or a pointer to an incomplete type other than (possibly cv-qualified) void.
This disallows cases like the following, because str has an incomplete type (an array of unknown size):
extern const char str[]; void f() { throw str; }
The array-to-pointer conversion is applied to the operand of throw, so there's no problem creating the exception object, which is the reason for the restriction on incomplete types. I believe this case should be permitted.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
2009-08-03 00:00:00 | admin | set | status: dr -> wp |
2009-03-23 00:00:00 | admin | set | messages: + msg2031 |
2009-03-23 00:00:00 | admin | set | status: ready -> dr |
2008-10-05 00:00:00 | admin | set | status: review -> ready |
2006-11-05 00:00:00 | admin | set | messages: + msg1410 |
2006-11-05 00:00:00 | admin | set | status: drafting -> review |
2005-05-01 00:00:00 | admin | set | messages: + msg1169 |
2005-05-01 00:00:00 | admin | set | status: open -> drafting |
2005-01-19 00:00:00 | admin | create |