Title
inline specifier in friend declarations
Status
cd1
Section
9.2.3 [dcl.fct.spec]
Submitter
John Spicer

Created on 2001-04-24.00:00:00 last changed 189 months ago

Messages

Date: 2002-10-15.00:00:00

[Moved to DR at October 2002 meeting.]

Date: 2001-10-15.00:00:00

Proposed resolution (10/01):

Add to the end of 9.2.3 [dcl.fct.spec] paragraph 3:

If the inline specifier is used in a friend declaration, that declaration shall be a definition or the function shall have previously been declared inline.
Date: 2001-04-15.00:00:00

Notes from the 04/01 meeting:

The consensus agreed with the suggested resolution. This outcome would be similar to the resolution of issue 136.

Date: 2004-09-10.00:00:00

There is currently no restriction on the use of the inline specifier in friend declarations. That would mean that the following usage is permitted:

    struct A {
        void f();
    };

    struct B {
        friend inline void A::f();
    };

    void A::f(){}

I believe this should be disallowed because a friend declaration in one class should not be able to change attributes of a member function of another class.

More generally, I think that the inline attribute should only be permitted in friend declarations that are definitions.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetstatus: dr -> wp
2002-11-08 00:00:00adminsetmessages: + msg770
2002-11-08 00:00:00adminsetstatus: ready -> dr
2002-05-10 00:00:00adminsetstatus: review -> ready
2001-11-09 00:00:00adminsetmessages: + msg550
2001-11-09 00:00:00adminsetstatus: open -> review
2001-05-20 00:00:00adminsetmessages: + msg505
2001-04-24 00:00:00admincreate