Movatterモバイル変換


[0]ホーム

URL:


Issue 40 - WG21 CWG Issues
Title
Syntax of declarator-id
Status
tc1
Section
9.3.4 [dcl.meaning]
Submitter
Mike Miller

Created on1998-09-01.00:00:00 last changed275 months ago

Messages

msg298 (view)
Date: 1999-10-15.00:00:00

Proposed Resolution for sub-issue 2 (10/99):

Change 9.3.4 [dcl.meaning] paragraph 1from:

Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct])or static data member (11.4.9 [class.static])or nested class (11.4.12 [class.nest]) outsideof its class, the definition or explicit instantiation of a function, variableor class member of a namespace outside of its namespace, or...
to
Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct])or static data member (11.4.9 [class.static])outsideof its class, the definition or explicit instantiation of a function orvariable member of a namespace outside of its namespace, or...
msg81 (view)
Date: 1999-10-15.00:00:00

Proposed Resolution for sub-issue 2 (10/99):

Change 9.3.4 [dcl.meaning] paragraph 1from:

Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct])or static data member (11.4.9 [class.static])or nested class (11.4.12 [class.nest]) outsideof its class, the definition or explicit instantiation of a function, variableor class member of a namespace outside of its namespace, or...
to
Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct])or static data member (11.4.9 [class.static])outsideof its class, the definition or explicit instantiation of a function orvariable member of a namespace outside of its namespace, or...
msg22 (view)
Date: 2022-11-20.07:54:16

(From J16/99-0005 = WG21 N1182, "Proposed Resolutions for CoreLanguage Issues 6, 14, 20, 40, and 89")

There are two sub-issues. The first concerns the statement in9.3.4 [dcl.meaning]paragraph 1,

Theid-expression of adeclarator-id shall bea simple identifier except for the declaration of some special functions(11.4.8 [class.conv],11.4.7 [class.dtor],12.4 [over.oper]) and for the declarationof template specializations or partial specializations(13.9 [temp.spec]).
The second sub-issue is regarding another statement in the same paragraph:
Adeclarator-id shall not be qualified except for thedefinition of a member function (11.4.2 [class.mfct])or static data member (11.4.9 [class.static])or nested class (11.4.12 [class.nest]) outsideof its class, the definition or explicit instantiation of a function, variableor class member of a namespace outside of its namespace, or...
Analysis

The problem in the first sub-issue is that the wrong syntactic non-terminalis mentioned. The relevant portions of the grammar are:

    declarator-id:
      id-expression
      ::opt nested-name-specifieropttype-name
    id-expression:
      unqualified-id
      qualified-id
    unqualified-id:
      identifier
      operator-function-id
      conversion-function-id
      ~class-name
      template-id
The exceptions in the citation from9.3.4 [dcl.meaning]paragraph 1 are all the non-identifier cases ofunqualified-id:11.4.8 [class.conv]is forconversion-function-ids,11.4.7 [class.dtor]is for destructors,12.4 [over.oper] isfor overloaded operators, and13.9 [temp.spec]is fortemplate-ids. If taken literally, this sentence would excludeallqualified-ids, which it obviously is not intended to do. Instead,the apparent intent is something along the lines of
If anunqualified-id is used as theid-expressionof adeclarator-id, it shall be a simple identifier except...
However, it does not appear that this restriction has any meaning; allof the possible cases ofunqualified-ids are represented in thelist of exceptions! Rather than recasting the sentence into a correct butuseless form, it would be better to remove it altogether.

The second sub-issue deals with the conditions under which aqualified-idcan be used in a declarator, including "the definition of a...nested class"and "the definition or explicit instantiation of a...class member of anamespace." However, the name in a class definition is not part of a declarator;these constructs do not belong in a list of declarator contexts.

Proposed Resolution for sub-issue 1 (04/99):

The suggested resolution for the first sub-issue overlooked thefact that the existing wording has the additional effect of prohibitingthe use of the non-identifier syntax for declaring other than thelisted entities. Thus the proposed wordingfor the first sub-issue is:

Change 9.3.4 [dcl.meaning] paragraph 1from:

Theid-expression of adeclarator-id shall be a simpleidentifier except...
to:
Anunqualified-id occurring in adeclarator-id shall be a simpleidentifier except...
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-02-23 00:00:00adminsetmessages: +msg298
2000-02-23 00:00:00adminsetstatus: ready -> dr
1999-09-14 00:00:00adminsetmessages: +msg81
1999-09-14 00:00:00adminsetstatus: drafting -> ready
1998-09-01 00:00:00admincreate

[8]ページ先頭

©2009-2025 Movatter.jp