Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-12-20


2831. Non-templated function definitions andrequires-clauses

Section:9.3.1  [dcl.decl.general]    Status:CD7    Submitter:Krystian Stasiowski    Date:2020-04-13

[Accepted as a DR at the March, 2024 meeting.]

(From editorial issue3936.)

Subclause 9.3.1 [dcl.decl.general] paragraph 4 specifies:

The optionalrequires-clause in aninit-declaratorormember-declarator shall be present only if the declaratordeclares a templated function (13.1 [temp.pre]). ...

This rule does not address function definitions, because those haveneither aninit-declarator nor amember-declarator.

Proposed resolution (approved by CWG 2024-03-20):

Change in 9.6.1 [dcl.fct.def.general] paragraph 1 as follows:

... The optionalattribute-specifier-seq inafunction-definition appertains to thefunction.Avirt-specifier-seq can bepart of afunction-definition only if it isfunction-definition with avirt-specifier-seq shall beamember-declaration (11.4 [class.mem]).Afunction-definition witharequires-clause shall define a templated function.



[8]ページ先頭

©2009-2026 Movatter.jp