Title
Storage class specifiers in definitions of class members
Status
open
Section
9.2.2 [dcl.stc]
Submitter
Matt Austern

Created on 2005-01-13.00:00:00 last changed 238 months ago

Messages

Date: 2005-04-15.00:00:00

Notes from the April, 2005 meeting:

The question about the linkage of class members is already covered by 6.6 [basic.link] paragraph 5.

Date: 2005-01-13.00:00:00

Suppose we've got this class definition:

    struct X {
       void f();
       static int n;
    };

I think I can deduce from the existing standard that the following member definitions are ill-formed:

    static void X::f() { }
    static int X::n;

To come to that conclusion, however, I have to put together several things in different parts of the standard. I would have expected to find an explicit statement of this somewhere; in particular, I would have expected to find it in 9.2.2 [dcl.stc]. I don't see it there, or anywhere.

Gabriel Dos Reis: Or in 6.6 [basic.link] which is about linkage. I would have expected that paragraph to say that that members of class types have external linkage when the enclosing class has an external linkage. Otherwise 6.6 [basic.link] paragraph 8:

Names not covered by these rules have no linkage.

might imply that such members do not have linkage.

History
Date User Action Args
2005-05-01 00:00:00adminsetmessages: + msg1174
2005-01-13 00:00:00admincreate