[clang] [Clang] Treat default template argument as constant expressions (PR #107073)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 3 04:39:39 PDT 2024
================
@@ -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);
----------------
cor3ntin wrote:
Oh, sorry. Yes
https://eel.is/c++draft/basic#def.odr-5
https://github.com/llvm/llvm-project/pull/107073
More information about the cfe-commits
mailing list