Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: The begin of the scope of an identifier

31 views
Skip to first unread message
Message has been deleted

Öö Tiib

unread,
Mar 5, 2015, 7:44:42 PM3/5/15
to
On Friday, 6 March 2015 02:06:22 UTC+2, Stefan Ram wrote:
> Sorry, I have tried to search for »scope« in the C++
> specification, but there are very many hits, and I gave up!
>
> Maybe some reader already knows the answer:
>
> It seems that the scope of »i« begins at the place
> of the comment in the following program.

Yes.

> constexpr int f( int const * const p ){ return 2; }
> int main(){ constexpr int i/**/{ f( &i ) }; }
>
> Now, I would like to know the location in the C++
> specification where this is specified.

[basic.scope.block] Says that scope of your i starts from
"point of declaration".
[basic.scope.pdecl] tells that the "point of declaration"
of your i is immediately after it and before its initializer.
0 new messages