[PATCH] D123840: [Clang][Sema] Fix invalid redefinition error in if/switch/for statement

Jun Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 06:49:19 PDT 2022


junaire marked an inline comment as done.
junaire added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:122
   This fixes Issue `Issue 54817 <https://github.com/llvm/llvm-project/issues/54817>`_.
+- No longer produce a wrong redefinition error if variables are defined in if/for/switch init statements
+  and lambda.
----------------
erichkeane wrote:
> I think this isn't accurate, right?  I thought this had to do with lambdas alone? Is the following accurate?
> 
> `Clang should no longer incorrectly diagnose a variable declaration inside of a lambda expression inside the scope of a if/while/for/switch init statement as a redeclaration.  This fixes ...'.
> I think this isn't accurate, right?  I thought this had to do with lambdas alone? Is the following accurate?
> 
> `Clang should no longer incorrectly diagnose a variable declaration inside of a lambda expression inside the scope of a if/while/for/switch init statement as a redeclaration.  This fixes ...'.

Thanks for the suggestion, It's my fault, I really shouldn't be sleeping in my English grammar class...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123840/new/

https://reviews.llvm.org/D123840



More information about the cfe-commits mailing list