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


1693. Superfluous semicolons in class definitions

Section:11.4  [class.mem]    Status:C++14    Submitter:Richard Smith    Date:2013-05-29

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

The grammar in 11.4 [class.mem] and 9.6.1 [dcl.fct.def.general] paragraph 1are (in part):

This leads to the following curiosity:

  struct A {    void f1() = delete;   // #1, ok    void f2() = delete;;  // #2, ok    void f3() = delete;;; // #3, error, extraneous semicolon  };

This could be addressed by moving the semicolon into the productionsforfunction-body for the non-default/deleteforms or by addingempty-declaration to the list ofmember-declaration productions, as is done with namespace-scopedeclarations.

Proposed resolution (November, 2013):

  1. Change the grammar in 11.4 [class.mem] as follows:

  2. Change 11.4 [class.mem] paragraph 1 as follows:

  3. ...Except when used to declare friends(11.8.4 [class.friend]) or to introduce the name of amember of a base class into a derived class(9.10 [namespace.udecl]),or when the declaration isanempty-declaration,member-declarationsdeclare members of the class, and eachsuchmember-declaration shall declare at least onemember name of the class.



[8]ページ先頭

©2009-2026 Movatter.jp