================ @@ -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:
OK, I'm sold. (The *intervening scope* concept is still a bit harder for me to understand at the moment, so I'll probably look into it at some point.) Feel free to merge this after one nit, which makes it a bit simpler ```cpp DefaultArg = Actions.ActOnConstantExpression(ParseInitializer()); ``` It would also be great if you could add the record-type case to the test. :) 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