================
@@ -27,8 +27,10 @@ ExprDependence clang::computeDependence(FullExpr *E) {
 
 ExprDependence clang::computeDependence(OpaqueValueExpr *E) {
   auto D = toExprDependenceForImpliedType(E->getType()->getDependence());
+  // An OpaqueValueExpr has no syntactic children, so it does not contain an
+  // unexpanded pack even if its source does.
   if (auto *S = E->getSourceExpr())
-    D |= S->getDependence();
+    D |= S->getDependence() & ~ExprDependence::UnexpandedPack;
   assert(!(D & ExprDependence::UnexpandedPack));
----------------
xakep8 wrote:

My intention was OpaqueValueExpr to inherit only the semantic dependence of its 
source, since the source is not one of its own AST children. The surrounding 
expression still contains the actual source and tracks the unexpanded pack.

I agree that explicitly masking the flag makes this look like it is bypassing 
the assertion. Would expressing the intent as `D |= 
Dependence(S->getDependence()).semantic().expr();` be clearer?

https://github.com/llvm/llvm-project/pull/237969
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to