Title
Omitted declarator in friend declarations
Status
nad
Section
9.1 [dcl.pre]
Submitter
Johannes Schaub

Created on 2011-05-27.00:00:00 last changed 119 months ago

Messages

Date: 2014-05-15.00:00:00

Rationale (May, 2014):

The friend specifier can only appear in a member-declaration, which contains a member-declarator-list, not an init-declarator-list.

Date: 2022-11-20.07:54:16

According to 9.1 [dcl.pre] paragraph 3,

In a simple-declaration, the optional init-declarator-list can be omitted only when declaring a class (Clause 11 [class]) or enumeration (9.7.1 [dcl.enum]), that is, when the decl-specifier-seq contains either a class-specifier, an elaborated-type-specifier with a class-key (11.3 [class.name]), or an enum-specifier.

This does not allow for the new simplified friend declaration syntax (11.8.4 [class.friend] paragraph 3), which permits the forms

    friend simple-type-specifier ;
    friend typename-specifier ;
History
Date User Action Args
2014-05-27 00:00:00adminsetmessages: + msg5062
2014-05-27 00:00:00adminsetstatus: drafting -> nad
2011-05-27 00:00:00admincreate