Title
Exception specifications on function parameters
Status
cd1
Section
14.5 [except.spec]
Submitter
Steve Adamczyk

Created on 1999-01-25.00:00:00 last changed 197 months ago

Messages

Date: 2001-04-15.00:00:00

[Moved to DR at 4/01 meeting.]

Date: 2001-04-15.00:00:00

[Moved to DR at 4/01 meeting.]

Date: 2022-11-20.07:54:16

In 14.5 [except.spec] paragraph 2:

An exception-specification shall appear only on a function declarator in a function, pointer, reference or pointer to member declaration or definition.
Does that mean in the top-level function declarator, or one at any level? Can one, for example, specify an exception specification on a pointer-to-function parameter of a function?
    void f(int (*pf)(float) throw(A))
Suggested answer: no. The exception specifications are valid only on the top-level function declarators.

However, if exception specifications are made part of a function's type as has been tentatively agreed, they would have to be allowed on any function declaration.

There is already an example of an exception specification for a parameter in the example in 14.5 [except.spec] paragraph 1.

Proposed resolution (04/01): Change text in 14.5 [except.spec] paragraph 1 from:

An exception-specification shall appear only on a function declarator in a function, pointer, reference or pointer to member declaration or definition.
to:
An exception-specification shall appear only on a function declarator for a function type, pointer to function type, reference to function type, or pointer to member function type that is the top-level type of a declaration or definition, or on such a type appearing as a parameter or return type in a function declarator.

(See also issues 25, 92, and 133.)

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetstatus: dr -> wp
2002-05-10 00:00:00adminsetmessages: + msg698
2001-05-20 00:00:00adminsetstatus: ready -> dr
2000-11-18 00:00:00adminsetstatus: review -> ready
2000-09-16 00:00:00adminsetstatus: drafting -> review
2000-02-23 00:00:00adminsetmessages: + msg242
2000-02-23 00:00:00adminsetstatus: open -> drafting
1999-01-25 00:00:00admincreate