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.spec.general] p2 prevents the valid type combination #4796
Comments
"atomic specifier" is a bad suggestion, because of the confusion with C's atomic type specifier. |
But they are different specifiers, which is fine, isn't it? It says "each" decl-specifier and that's true. Each of them appears at most once, except |
In the grammar tree of decl-specifier [dcl.spec.general] p1, it lists all components that are decl-specifiers, "each decl-specifier" sounds like it says each component in that tree. As you said, from the perspective of specifiers, they are different specifiers, but from the perspective of decl-specifiers, they are all |
Analogy, when we say each pm-expression shall appear at most once in ...xxx . What does it mean? Should we consider any direct sub-element categories to pm-expression as a unit or something others? In other words, Does it mean cast-expression shall appear at most once or unary-expression or postfix-expression or each indivisible expression(minimum unit)? Specifically, given the definition for X as the following
We say each X shall appear at most once in my box. Now, there are two different kinds of eggs(e.g., ostrich egg, duck egg) in this box, we cannot say eggs only appear once in my box merely due to the two eggs have different kinds. |
So, the issue is whether we need to decompose decl-specifier into its parts, and how far that decomposition goes (e.g. are tokens inside |
The expression in I don't figure out a fine way to phrase them except that the wording indivisible decl-specifier, that means the most degree of decomposing the decl-specifier defined in the grammar tree. |
That's all fine, but |
the two "int", in my mind, belong to the different complete decl-specifier-seqs of two parameter-declarations. So, it's fine here. And [dcl.dcl.dcl.pre] p2 also has an extra expound.
Even though the parameters have abstract-declarators, but they still obey the above rules due to [dcl.dcl#dcl.decl.general-2]
|
If this is worth addressing at all, how about:
It seems clear to me that |
Actually, this issue claims that what is the degree of classification when we say "each decl-specifier". Does it refer to these components that are directly subsumed to The "adjective" that can exactly express that we shouldn't consider "each decl-specifier" just on the top-level of the grammar tree is significant. |
It is understood that the specification here does not have utmost precision.
While I think the situation is sufficiently clear for type-specifiers and other single-keyword specifiers appearing there, it is less clear for something like:
Obviously, |
In this declaration, the complete decl-specifier-seq is
unsigned long long int const volatile
. Where unsigned, long, long, int are all simple-type-specifiers, which in turn are type-specifiers, which are also defining-type-specifiers; While const and volatile are both cv-qualifiers, which are type-specifiers, which are also defining-type-specifiers. Hence, in this complete decl-specifier-seq, the defining-type-specifier appears six times.However, [dcl.spec.general] p2 says
Obviously, defining-type-specifier appears more than once that are not only long. I think the intent of this rule says each indivisible specifier shall appear at most once except that long may appear twice, I would like to name the indivisible specifier as atomic specifier(e.g., int, long, short, const, virtual, explicit ...). But It's not formal wording, maybe we can use some terms to precisely phrase such the meaning?
The text was updated successfully, but these errors were encountered: