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
[dcl.enum] Merge duplicate normative paragraphs on redeclarations. #1827
Conversation
source/declarations.tex
Outdated
@@ -2040,10 +2040,15 @@ | |||
If the \grammarterm{enum-key} is followed by a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add "in an enum-head or opaque-enum-declaration" after "enum-key". I think we may have duplicated this previously as a misguided and unclear attempt to address both cases separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, could we refactor opaque-enum-declaration to use enum-head-name, and reference that here? That would avoid confusion over whether this applies if there is an intervening attribute-specifier-seq.
@jensmaurer: actionable comments here |
Actions performed. @zygoloid is next. |
Looks good, let's apply this after the Jacksonville motions. |
source/declarations.tex
Outdated
\grammarterm{nested-name-specifier}, the \grammarterm{enum-specifier} shall | ||
If an \grammarterm{enum-head-name} contains a | ||
\grammarterm{nested-name-specifier}, the latter | ||
shall not begin with a \grammarterm{decltype-specifier} and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this decltype
rule for opaque-enum-declarations present before (maybe implied by pre-existing wording)? I see we had such a rule for enum-heads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we have (unchanged from before):
If an \grammarterm{opaque-enum-declaration} contains
a \grammarterm{nested-name-specifier},
the declaration shall be an explicit specialization\iref{temp.expl.spec}.
and we have
11.3 [dcl.meaning]
The nested-name-specifier of a qualified declarator-id shall not begin with a decltype-specifier.
That seems close enough to me. (it seems we don't want redeclarations to use decltype to nominate the entity being redeclared. Which is totally reasonable.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we don't want to allow decltype
here, and indeed current implementations don't distinguish between the opaque enum declaration case and the regular enum case, but if this is a normative change (as it appears to be), we should fix that portion of this via the CWG issue process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by limiting the prohibition to the enum-head case.
Rebased. |
@zygoloid says:
Let's run this by CWG then. |
e3dbfe2
to
1a21a65
Compare
Also introduce the grammar non-terminal enum-head-name to simplify the description.
Rebased. |
CWG in San Diego: Fine with the change. http://wiki.edg.com/pub/Wg21sandiego2018/CoreWorkingGroup/cwg-ed1827.html |
Fixes #1826.