[PATCH] D108482: [Clang] Fix instantiation of OpaqueValueExprs (Bug #45964)

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 30 04:38:46 PDT 2021


aaron.ballman added a reviewer: rjmccall.
aaron.ballman added a subscriber: rjmccall.
aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/TreeTransform.h:10515-10525
+  // Note that SourceExpr can be nullptr.
+  ExprResult SourceExpr = TransformExpr(E->getSourceExpr());
+  if (SourceExpr.isInvalid())
+    return ExprError();
+  if (SourceExpr.get() == E->getSourceExpr() && !getDerived().AlwaysRebuild())
+    return E;
+
----------------
These changes look correct to me, but I am not certain why they've been unnecessary for so long. This code is 11 years old and has never transformed the `OpaqueValueExpr` before (see https://github.com/llvm/llvm-project/commit/8d69a2160e48b73a4515c9401e67971fb8c14e07). @rjmccall, was this an oversight and we just got lucky for a long time, or is there a reason we didn't transform these expressions?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108482



More information about the cfe-commits mailing list