Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[basic.def] 'class name declaration' is undefined. #1817

Merged
merged 1 commit into from Feb 12, 2018

Conversation

jensmaurer
Copy link
Member

Fixes #1641.

source/basic.tex Outdated
@@ -128,7 +128,7 @@
specifier (this usage is deprecated; see \ref{depr.static_constexpr}),
\item
\indextext{declaration!class name}%
it is a class name declaration\iref{class.name},
it is an \grammarterm{elaborated-type-specifier}\iref{class.name},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a category error here; an elaborated-type-specifier is not a declaration.

[I think the existing wording was attempting to refer to this portion of [class.name]p2: "A declaration consisting of class-key identifier; [...] introduces the class name into the current scope." but generalizing this to apply to other cases in which elaborated-type-specifiers introduce class-names seems like a good idea.]

To some extent the problem is that this whole paragraph is bogus: "A declaration is a definition unless" is one big category error. A declaration declares zero or more entities, defines zero or more entities, and introduces zero or more names. But it's wrong to say that a declaration "is" or "is not" a definition.

Perhaps a different structure would help. For instance:

Each entity declared by a declaration is also defined by that declaration unless:

  • [...]
  • the entity is introduced by an elaborated-type-specifier,
  • [...]
    A declaration is said to be a definition of each entity that it defines.

Or perhaps we need to formally divorce the notion of "declaration" (the grammar element) and "declaration" (the portion of a declaration that declares a specific entity).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the "different structure" approach, absent the major task of doing the divorce.

@jensmaurer
Copy link
Member Author

jensmaurer commented Feb 12, 2018

Update as per @zygoloid's desires + rebased.

@zygoloid zygoloid merged commit e5ec8c8 into cplusplus:master Feb 12, 2018
@jensmaurer jensmaurer deleted the b11 branch February 12, 2018 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants