[PATCH] D100347: Fix the const overload of IgnoreExprNodes

2021-04-12 Thread Jesse Zhang via Phabricator via cfe-commits
d created this revision.
d requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The existing code causes an infinite recursion. This is likely an
oversight of commit c0e5e3fbfa504c37 
 [1] where 
the intent must have been
to call the non-const overload.

[1] https://reviews.llvm.org/D87278


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100347

Files:
  clang/include/clang/AST/IgnoreExpr.h


Index: clang/include/clang/AST/IgnoreExpr.h
===
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -41,7 +41,7 @@
 
 template 
 const Expr *IgnoreExprNodes(const Expr *E, FnTys &&...Fns) {
-  return const_cast(IgnoreExprNodes(E, std::forward(Fns)...));
+  return IgnoreExprNodes(const_cast(E), std::forward(Fns)...);
 }
 
 inline Expr *IgnoreImplicitCastsSingleStep(Expr *E) {


Index: clang/include/clang/AST/IgnoreExpr.h
===
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -41,7 +41,7 @@
 
 template 
 const Expr *IgnoreExprNodes(const Expr *E, FnTys &&...Fns) {
-  return const_cast(IgnoreExprNodes(E, std::forward(Fns)...));
+  return IgnoreExprNodes(const_cast(E), std::forward(Fns)...);
 }
 
 inline Expr *IgnoreImplicitCastsSingleStep(Expr *E) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100347: Fix the const overload of IgnoreExprNodes

2021-04-12 Thread Jesse Zhang via Phabricator via cfe-commits
d updated this revision to Diff 336983.
d added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100347

Files:
  clang/include/clang/AST/IgnoreExpr.h


Index: clang/include/clang/AST/IgnoreExpr.h
===
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -41,7 +41,7 @@
 
 template 
 const Expr *IgnoreExprNodes(const Expr *E, FnTys &&...Fns) {
-  return const_cast(IgnoreExprNodes(E, std::forward(Fns)...));
+  return IgnoreExprNodes(const_cast(E), std::forward(Fns)...);
 }
 
 inline Expr *IgnoreImplicitCastsSingleStep(Expr *E) {


Index: clang/include/clang/AST/IgnoreExpr.h
===
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -41,7 +41,7 @@
 
 template 
 const Expr *IgnoreExprNodes(const Expr *E, FnTys &&...Fns) {
-  return const_cast(IgnoreExprNodes(E, std::forward(Fns)...));
+  return IgnoreExprNodes(const_cast(E), std::forward(Fns)...);
 }
 
 inline Expr *IgnoreImplicitCastsSingleStep(Expr *E) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100347: Fix the const overload of IgnoreExprNodes

2021-04-13 Thread Jesse Zhang via Phabricator via cfe-commits
d added a comment.

In D100347#2684934 , @gribozavr2 
wrote:

> Thanks for the fix! Do you have commit access?

Trying `arc land` I realize I do not...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100347

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100347: Fix the const overload of IgnoreExprNodes

2021-04-13 Thread Jesse Zhang via Phabricator via cfe-commits
d added a comment.

@gribozavr2 it's also unclear to me where the tests for this are so I couldn't 
add a new test, is that OK?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100347

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100347: Fix the const overload of IgnoreExprNodes

2021-04-13 Thread Jesse Zhang via Phabricator via cfe-commits
d added a comment.

More importantly, the bug exists in LLVM 12, what is the policy of patching the 
back branches in this project?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100347

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits