- Title
- What is the type matched by an exception handler?
- Status
- tc1
- Section
- 14.4 [except.handle]
- Submitter
- Scott Douglass
Created on 2000-03-06.00:00:00 last changed 55 months ago
Messages
Date: 2000-10-15.00:00:00
Proposed resolution (10/00): Change 14.2 [except.throw] paragraph 3 from to Change 14.4 [except.handle] paragraph 3 from to
A throw-expression initializes a temporary object, the type of
which is determined...
A throw-expression initializes a temporary object, called the
exception object, the type of which is determined...
A handler is a match for a throw-expression with an
object of type E if...
A handler is a match for an exception object of type E
if...
Date: 2000-10-15.00:00:00
Proposed resolution (10/00): Change 14.2 [except.throw] paragraph 3 from to Change 14.4 [except.handle] paragraph 3 from to
A throw-expression initializes a temporary object, the type of
which is determined...
A throw-expression initializes a temporary object, called the
exception object, the type of which is determined...
A handler is a match for a throw-expression with an
object of type E if...
A handler is a match for an exception object of type E
if...
Date: 2026-07-25.21:52:10
14.4 [except.handle] paragraph 3 says, This wording leaves it unclear whether it is the dynamic type of the
object being thrown or the static type of the expression that
determines whether a handler is a match for a given exception. For
instance, In this code, presumably the type to be matched is B and not
const D (14.2 [except.throw]).
Suggested resolution: Replace the cited wording as follows:
A handler is a match for a throw-expression with an
object of type E ...
struct B { B(); virtual ~B(); };
struct D : B { D(); };
void toss(const B* b) { throw *b; }
void f() { const D d; toss(&d); }
A handler is a match for a throw-expression which
initialized a temporary (14.2 [except.throw]) of type
E ...
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-02-18 07:47:23 | admin | set | messages: + msg6652 |
| 2003-04-25 00:00:00 | admin | set | status: dr -> tc1 |
| 2000-11-18 00:00:00 | admin | set | status: ready -> dr |
| 2000-05-21 00:00:00 | admin | set | messages: + msg331 |
| 2000-03-06 00:00:00 | admin | create | |