C++ Logo


Advanced search

Re: Local variables

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Mon, 21 Feb 2022 14:05:56 +0300
On 18/02/2022 01:27, Jason McKesson via Std-Discussion wrote:
> On Thu, Feb 17, 2022 at 3:03 PM language.lawyer--- via Std-Discussion
> <std-discussion_at_[hidden]> wrote:
>> On 17/02/2022 22:48, Vladimir Grigoriev via Std-Discussion wrote:
>>> Why are not block scope variables declared with the specifier static considered as local variables in the C++ Standard?
> They are. See below.
>> AFAIK currently there is no definition of such thing as local variable.
> There is no such definition in post-C++20. But in C++20 and before,
> there has been. From [basic.scope.block]/1:
>> A variable declared at block scope is a local variable.
> The current working draft in the same section calls them "block variables".

I know, but the draft still mentions Ā«local variableĀ» in few places (didn't check if they are normative). I think this is just part of variable/object mess.

Received on 2022-02-21 11:06:00