Movatterモバイル変換


[0]ホーム

URL:


Issue 1777 - WG21 CWG Issues
Title
Empty pack expansion in dynamic-exception-specification
Status
cd4
Section
14.5 [except.spec]
Submitter
Richard Smith

Created on2013-09-24.00:00:00 last changed109 months ago

Messages

msg5426 (view)
Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

msg4859 (view)
Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

Change 14.5 [except.spec] paragraph 12 as follows:

A function with noexception-specification or withanexception-specification of the formnoexcept(constant-expression) wheretheconstant-expression yieldsfalse allows allexceptions. Anexception-specification isnon-throwing if it isof the formthrow(),noexcept, ornoexcept(constant-expression) where theadynamic-exception-specificationwhose set of adjusted types is empty (after any packs are expanded) or anoexcept-specification whoseconstant-expressionis either absent or yieldstrue. A function with anon-throwingexception-specification does not allow any exceptions.
msg4674 (view)
Date: 2013-09-24.00:00:00

According to 13.7.4 [temp.variadic] paragraph 6, describingan empty pack expansion,

WhenN is zero, the instantiation of the expansion produces an emptylist. Such an instantiation does not alter the syntactic interpretation ofthe enclosing construct, even in cases where omitting the list entirelywould otherwise be ill-formed or would result in an ambiguity in thegrammar.

This leaves open the question of whether something like

  template<typename...T> void f() throw(T...);

should be considered to have a non-throwingexception-specification whenT... is empty. The definitionin 14.5 [except.spec] paragraph 12 appears to be syntacticregardingdynamic-exception-specifications:

Anexception-specification isnon-throwing if it is of theformthrow(),noexcept,ornoexcept(constant-expression) wheretheconstant-expression yieldstrue. A function with anon-throwingexception-specification does not allow any exceptions.

It seems evident, however, that adynamic-exception-specificationwith an empty pack expansion “does not allow any exceptions.”

History
DateUserActionArgs
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: +msg5426
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: +msg4859
2014-03-03 00:00:00adminsetstatus: open -> ready
2013-09-24 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp