The point of declaration for a name is immediately after its complete declarator (Clause 11) and before its
initializer (if any), except as noted below. [ Example:
unsigned char x = 12;
{ unsigned char x = x; }
Here the second x is initialized with its own (indeterminate) value. —end example ]
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
Notes and examples are non-nominative. They don't count and as such are not included in the "below" that the last sentence refers to. Don't know if this counts as misleading or not :)
--
But you can't delete it! It's necessary, and maybe it would make sense to reword it, I don't just don't know.Without it, something likeusing Foo = int;Foo f; // oh no, ill-formedwill be ill-formed because name `Foo` doesn't have a declarator.
Not extremely clear perhaps, but I read "except" as referring to the
rules in the rest of the section, not to the example immediately following.
Isn't that what I said? Without this except, there wouldn't be any named introduced by the using declaration, so that's why it's important :)
--
Not sure I'm following you. In "using Foo = int", there is an
exception to the general rule that the point of declaration of a name
is immediately following its declarator. Namely: "The point of
declaration of an alias or alias template immediately follows the
type-id to which the alias refers." . Without this exception, "Foo"
wouldn't have a "point of declaration" or the general rule would be
ill-worded (pick your favourite), because there's no declarator.
From: Alexander Sent: Sunday, April 15, 2018 1:19 PM To: ISO C++ Standard - Discussion Reply To: std-dis...@isocpp.org Subject: Re: [std-discussion] The word 'except' in [basic.scope.pdecl]/1 seems misleading. |
Regardless of the technical conclusion, the real conclusion is that the note/example is in a confusing spot.Maybe it could be moved up a bit, or moved down past the list of exceptions, where you could have examples of all cases.
Sent from my BlackBerry portable Babbage Device
From: AlexanderSent: Sunday, April 15, 2018 1:19 PMTo: ISO C++ Standard - DiscussionReply To: std-dis...@isocpp.orgSubject: Re: [std-discussion] The word 'except' in [basic.scope.pdecl]/1 seems misleading.
--
On Sunday, April 15, 2018 at 1:24:14 PM UTC-3, Johannes Schaub wrote:
Not sure I'm following you. In "using Foo = int", there is an
exception to the general rule that the point of declaration of a name
is immediately following its declarator. Namely: "The point of
declaration of an alias or alias template immediately follows the
type-id to which the alias refers." . Without this exception, "Foo"
wouldn't have a "point of declaration" or the general rule would be
ill-worded (pick your favourite), because there's no declarator.You're completely right. I missed that part in paragraph 3. Thus, there is o need for a new paragraph in 6.3.2 [basic.scope.pdecl] to handle this exception.
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.