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
[Voted into the WP at the February, 2012 meeting;moved to DR at the October, 2012 meeting.]
According to 9.3.4 [dcl.meaning] paragraph 1,
Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct]) orstatic data member (11.4.9 [class.static]) outside of itsclass, the definition or explicit instantiation of a function orvariable member of a namespace outside of its namespace, or thedefinition of a previously declared explicit specializationoutside of its namespace, or the declaration of a friend functionthat is a member of another class or namespace (11.8.4 [class.friend]). When thedeclarator-id is qualified, thedeclaration shall refer to a previously declared member of theclass or namespace to which the qualifier refers...
This restriction prohibits examples like the following:
void f(); void ::f(); // error: qualified declarator namespace N { void f(); void N::f() { } // error: qualified declarator }There doesn't seem to be any good reason for disallowing suchdeclarations, and a number of implementations accept them inspite of the Standard's prohibition. Should the Standard bechanged to allow them?
Notes from the April, 2006 meeting:
In discussingissue 548, the CWG agreedthat the prohibition of qualified declarators inside their namespaceshould be removed.
Proposed resolution (October, 2006):
Remove the indicated words from 9.3.4 [dcl.meaning] paragraph 1:
...Anunqualified-id occurring in adeclarator-id shallbe a simpleidentifier except for the declaration of somespecial functions (11.4.8 [class.conv], 11.4.7 [class.dtor], 12.4 [over.oper]) and for the declaration oftemplate specializations or partial specializations (13.9 [temp.spec]).Adeclarator-id shall not be qualifiedexcept for the definition of a member function (11.4.2 [class.mfct]) or static data member (11.4.9 [class.static])outside of its class, the definition or explicit instantiation of afunction or variable member of a namespace outside of its namespace,or the definition of a previously declared explicit specializationoutside of its namespace, or the declaration of a friend function thatis a member of another class or namespace (11.8.4 [class.friend]).When thedeclarator-id is qualified, thedeclaration shall refer to a previously declared member of the classor namespace to which the qualifier refers, and the member shall nothave been introduced by ausing-declaration in the scope of theclass or namespace nominated by thenested-name-specifier ofthedeclarator-id...
[Drafting note: The omission of “outside of itsclass” here does not give permission for redeclaration ofclass members; that is still prohibited by 11.4 [class.mem] paragraph 1. The removal of the enumeration of the kinds ofdeclarations in which aqualified-id can appear does allowatypedef declaration to use aqualified-id, whichwas not permitted before; if that is undesirable, the prohibition canbe reinstated here.]