================ @@ -960,6 +960,8 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) { EnterExpressionEvaluationContext ConstantEvaluated( Actions, Sema::ExpressionEvaluationContext::ConstantEvaluated); DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseInitializer()); + if (DefaultArg.isUsable()) + DefaultArg = Actions.ActOnConstantExpression(DefaultArg); ---------------- zyn0217 wrote:
If you look at `Sema::CheckLValueToRValueConversionOperand()`, it would bail out if `E` is of a RecordType. So the following would still be rejected ```cpp struct S {}; void foo() { constexpr S x{}; auto a = []<auto = x>{}; } ``` https://github.com/llvm/llvm-project/pull/107073 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits