aaron.ballman added a reviewer: rsmith.
aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaInit.cpp:8646
       Expr *Cur = CurInit.get();
-      Expr *BaseExpr = new (S.Context)
-          OpaqueValueExpr(Cur->getExprLoc(), Cur->getType(),
-                          Cur->getValueKind(), Cur->getObjectKind(), Cur);
+      // prevent nested OpaqueValueExprs
+      Expr *BaseExpr = dyn_cast<OpaqueValueExpr>(Cur);
----------------



================
Comment at: clang/lib/Sema/TreeTransform.h:10515
+
+  // Note that SourceExpr can be nullptr
+  ExprResult SourceExpr = TransformExpr(E->getSourceExpr());
----------------



================
Comment at: clang/lib/Sema/TreeTransform.h:10519-10521
+  if (SourceExpr.get() == E->getSourceExpr() && !getDerived().AlwaysRebuild()) 
{
+    return E;
+  }
----------------



================
Comment at: clang/test/SemaCXX/pr45964-nested-ove.cpp:1
+// RUN: %clang_cc1 -std=c++17 -emit-codegen-only -verify %s
+// Don't crash (Bugzilla - Bug 45964).
----------------
I think this test should live in CodeGenCXX rather than SemaCXX as it's testing 
codegen stuff (and rather than discarding the output, I'd recommend checking 
the output with `FileCheck` to verify that it looks valid).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108482

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

Reply via email to