================ @@ -1767,10 +1780,16 @@ static bool CheckConstexprParameterTypes(Sema &SemaRef, /// true. If not, produce a suitable diagnostic and return false. static bool CheckConstexprReturnType(Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind Kind) { - if (CheckLiteralType(SemaRef, Kind, FD->getLocation(), FD->getReturnType(), - diag::err_constexpr_non_literal_return, - FD->isConsteval())) + if (CheckLiteralType( + SemaRef, Kind, FD->getLocation(), FD->getReturnType(), + SemaRef.getLangOpts().CPlusPlus23 + ? diag::warn_cxx23_compat_constexpr_non_literal_return + : diag::ext_constexpr_non_literal_return, + FD->isConsteval())) { + if (SemaRef.getLangOpts().CPlusPlus23) + return true; return false; + } ---------------- cor3ntin wrote:
ditto https://github.com/llvm/llvm-project/pull/77753 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits