Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[basic.scope.scope] The meaning of "denote different entities" is vague #4787

Copy link
Copy link
Open
@xmh0511

Description

@xmh0511
Issue body actions

Two declarations potentially conflict if they correspond and cause their shared name to denote different entities ([basic.link]).

Since [basic.link] follows "different entities", it hints that the meaning of "different entities" is given in [basic.link#8]. Consider this example

void fun();
extern int fun;

According to [basic.scope.scope#3], such two declarations correspond, and according to [basic.link#8], they declare the same entity. According to [basic#pre-5]

An entity E is denoted by the name (if any) that is introduced by a declaration of E or by a typedef-name introduced by a declaration specifying E.

Since these two declarations declare the same entity, does it mean the names fun in the two declarations denote the same entity? However, according to [basic#pre-3]

An entity is a value, object, reference, structured binding, function, enumerator, type, class member, bit-field, template, template specialization, namespace, or pack.

How can a function and a variable be the same entity? It seems result in this issue. That is, what's the exact meaning of "denote different entities"? Merely determined by [basic.link#8] or should base it on by adding some other restrictions?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.