[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 08:28:56 PDT 2024


================
@@ -2177,7 +2177,8 @@ struct CounterCoverageMappingBuilder
   }
 
   void VisitOpaqueValueExpr(const OpaqueValueExpr* OVE) {
-    Visit(OVE->getSourceExpr());
+    if (const Expr *SE = OVE->getSourceExpr())
----------------
efriedma-quic wrote:

The point of the "unique" flag is precisely to indicate whether a subexpression is naturally part of the tree at that point, or it's referring to an expression which should have been evaluated elsewhere.  So not visiting a non-unique expression should be the right default.

I didn't realize the existing AbstractConditionalOperator code already had a workaround for this... we should be able to adjust it to compensate.

https://github.com/llvm/llvm-project/pull/85837


More information about the cfe-commits mailing list