Title
Linkage and unclear "can be referred to"
Status
open
Section
6.6 [basic.link]
Submitter
Brian Bi

Created on 2024-03-08.00:00:00 last changed 1 month ago

Messages

Date: 2024-03-18.19:45:04

It is unclear what "can be referred to" means in 6.6 [basic.link] paragraph 2. Paragraph 8 provides precise definitions for "same entity".

Possible resolution:

  1. Replace in 6.6 [basic.link] paragraph 2 as follows:

    A name is said to have linkage when it can denote the same object, reference, function, type, template, namespace or value as a name introduced by a declaration in another scope:
    • When a name has external linkage, the entity it denotes can be referred to by names from scopes of other translation units or from other scopes of the same translation unit.
    • When a name has module linkage, the entity it denotes can be referred to by names from other scopes of the same module unit (10.1 [module.unit]) or from scopes of other module units of that same module.
    • When a name has internal linkage, the entity it denotes can be referred to by names from other scopes in the same translation unit.
    • When a name has no linkage, the entity it denotes cannot be referred to by names from other scopes.
    A name can have external linkage, module linkage, internal linkage, or no linkage, as determined by the rules below. [ Note: The linkage of a name determines when corresponding declarations (6.4.1 [basic.scope.scope]) that introduce that name can declare the same entity. ---end note]
  2. Change in 11.6 [class.local] paragraph 3 as follows:

    If class X is a local class, a nested class Y may be declared in class X and later defined in the definition of class X or be later defined in the same scope as the definition of class X. A class nested within a local class is a local class. A member of a local class X shall be declared only in the definition of X or the nearest enclosing block scope of X.
History
Date User Action Args
2024-03-08 00:00:00admincreate