================
@@ -6464,6 +6464,9 @@ static ExprResult BuildConvertedConstantExpression(Sema 
&S, Expr *From,
   if (checkPlaceholderForOverload(S, From))
     return ExprError();
 
+  if (From->containsErrors())
+    return S.CreateRecoveryExpr(From->getBeginLoc(), From->getEndLoc(), 
{From}, T);
----------------
Serosh-commits wrote:

my initial concern was that BuildConvertedConstantExpression is expected to 
return an expr  of type T. While returning ExprError() is safe because callers 
check isInvalid() immediately, it leaves the specifier with a nullptr expr in 
the ast, i think Using a RecoveryExpr with type T keeps the AST typed right 
while still marking the error.  that the safer option here isn't it ?

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

Reply via email to