This is an archive of the discontinued LLVM Phabricator instance.

[clang][Sema] `-Wshadow` warns about shadowings by static local variables
ClosedPublic

Authored by hazohelet on May 23 2023, 7:40 AM.

Details

Summary

This patch makes -Wshadow warn about the shadowings by static local variables.

Fixes https://github.com/llvm/llvm-project/issues/62850

Diff Detail

Event Timeline

hazohelet created this revision.May 23 2023, 7:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 7:40 AM
hazohelet requested review of this revision.May 23 2023, 7:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 7:40 AM
tbaeder added inline comments.May 23 2023, 7:44 AM
clang/docs/ReleaseNotes.rst
300
shafik accepted this revision.May 23 2023, 12:01 PM

LGTM

clang/test/SemaCXX/warn-shadow.cpp
33

Note. it looks like gcc does not warn on shadowing for anonymous namespaces. I think it makes sense to warn in this case.

This revision is now accepted and ready to land.May 23 2023, 12:01 PM