Skip to content
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

Replace the uses of "local variable" with "[block] variable with automatic storage duration" #7307

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Oct 16, 2024

P1787R6 dropped the previous buggy uses and definition of term local variable. But there're many remaining use of local variable.

This PR removes the remaining occurences except for one "conceptual local variable" in a comment (which seems OK to me as we're not talking about real local variable).

Fixes #6617.

@jensmaurer
Copy link
Member

I would prefer to replace the remaining uses of "local variable" with "[block] variable with automatic storage duration" for consistency, instead of reintroducing a term that CWG agreed to abolish.

@frederick-vs-ja frederick-vs-ja changed the title [basic.scope.block] Reintroduce local variable Remove occurences of "local variable" Oct 16, 2024
@frederick-vs-ja frederick-vs-ja changed the title Remove occurences of "local variable" Replace the uses of "local variable" with "[block] variable with automatic storage duration" Oct 16, 2024
@frederick-vs-ja
Copy link
Contributor Author

I would prefer to replace the remaining uses of "local variable" with "[block] variable with automatic storage duration" for consistency, instead of reintroducing a term that CWG agreed to abolish.

Thanks. I'm now switching to this direction.

source/locales.tex Outdated Show resolved Hide resolved
@FrankHB
Copy link
Contributor

FrankHB commented Oct 16, 2024

I would prefer to replace the remaining uses of "local variable" with "[block] variable with automatic storage duration" for consistency, instead of reintroducing a term that CWG agreed to abolish.

They are not equivalent. The term "local variable" has nothing to do with the storage duration at all, it is now just "block variable", not necessarily "with automatic storage duration"; although most use cases apparently imply this. And personally I don't like too many occurence of the lengthy "with automatic storage duration" phrase when the storage duration is contextually clear enough.

@jensmaurer
Copy link
Member

@FrankHB , works for me; I haven't looked at the details. If we mean "block variable", we should say so. If we mean "with automatic storage duration", we also should say so.

Replace the uses of "local variable" with "[block] variable with
automatic storage duration". Sometimes the automatic storage duration"
can be inferred from the context.
@frederick-vs-ja
Copy link
Contributor Author

And personally I don't like too many occurence of the lengthy "with automatic storage duration" phrase when the storage duration is contextually clear enough.

Yeah. I wish it's clear enough to suppose the automatic storage duration can be implied by not using static or thread_local in the library wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[basic.scope.block] et al. - Ambiguous definition of "local variable"
3 participants