Prevents confusion over which S is referenced in the final else branch if such use is added.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@ken-matsui, can you provide some rationale for the change (got compiler warning/error)?
Sorry to have missed providing a summary.
In most cases, shadowing a declaration of a local variable should be avoided to prevent making others confused and mistakes because we need to figure out the boundaries of the declaration. In this case, the variable declared by const char *S in if can be accessed by every branch. That means that declarations in else if had shadowed the declaration in if, so I changed them to use the same declaration used in if.
You can still provide one by using the "Edit Revision" link.
I suggest something like:
Prevents confusion over which S is referenced in the final else branch if such a use is added.
Sorry, I'm a newbie here, but is there anything I should do after getting approved?
(I could not execute arc land due to 403 error to the llvm-project)
remote: Permission to llvm/llvm-project.git denied to ken-matsui. fatal: unable to access 'https://github.com/llvm/llvm-project.git/': The requested URL returned error: 403
I'm not sure if the instructions are a bit out-of-date: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
If you intend to contribute going forward, the idea would be to get a few patches approved and committed on your behalf and then to request commit access. Until you have commit access, you will need to ask people on the review to help you commit.
I can commit this patch for you.