From nobody Sat Mar 23 12:07:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V1yd501lDz5FJ5f; Sat, 23 Mar 2024 12:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V1yd46gQLz4qGx; Sat, 23 Mar 2024 12:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711195672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cNWo6BcIE7kIwM2eb1f9g1iW/Mk5LvRTI1NiJThRccU=; b=tHX+igyD+FqVhHlJlpQMMvJeY0y4lt7xRcpEUBR3tZUVTsd2kQH4Mh664yLy9eqYCxniAV BU5BR19nRyRuMtZJIl+xU9Uxgkb0+efDYUPbY8RyTNUT1cOp3g58O/iXSoG1Nn0/RxHhut +0oPg0tDOoIIb746XZUp+rjEehBY06SEXv9NnMfPcODORU/r9ihPjF5GBRF8+nQOaeixpa zb7zGfhqHZCG4Drofi3KVmpDqUgckXEMny2wI2mfse+bCMbtiG715nIrpttM9yKR7H9LIV UwW9Z+8OYT/eI+2leYa6KZK3v+2Qn14NsUIlJUMuxfLuRdh17iSCY0AjL8LytQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711195672; a=rsa-sha256; cv=none; b=sEcGY7PxWxXYdiNSPnUsd/7SN3SaavVHwmCqDgFNstwuiT95/jcEnI4togivC95VMc7+NJ NHbjz3jbgHIMUlTjElOyzfHpgIEGLWZ5aWDF3Ftexly2Pi0lV2a31iqMLh21WFkdFTfYR5 Is4UAs1tPXsG3ZrRv2dDz3r28MTX5ULF7uslsmTdt1tv6tDARPvgDUHbbuqPXfMTEvGxs9 8mwk8ddJOpqoECMRXXc8uf6i4oWA3BJi6dKcypCKBHQApYn84XqxBspHKJTNTux/ac3YDd h1Feg1h9J86PxbkY6amyjLzrbMv8cC2MW9VnHT/DSiZdNvqefVQB88rhTP8D8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711195672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cNWo6BcIE7kIwM2eb1f9g1iW/Mk5LvRTI1NiJThRccU=; b=k9oh2fyf3fNCBgpXwAiB36UrUtlFZMPygB6cH3GtuksuyfNSA+o3goVSqFIJxYsE32Jbzh mqH3ukCY0F0IaO2AWla3BtMo1ZLKkdHy00Di48iJnj/qKnXR+pfPTZoj/LMToR62lrMM0y VPJHvZCrjCOFUm75lsULyWJ+S5yyID8Dl5ppH+8pBVqCPuRLcQdyHGbjmV0vAzIgi+b4qd W5mkxoGfQGxRqtLkHKTYWfNxc280gsMgBneLaUGjwWEm9+LCrIDlRWH7oPVWKjl8tWwJDC stzXW85D6zzOTG+E4ObolQVfrrBpcfWFInKlES2XQAw0eQ2IwSGKMeJoD6fQZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V1yd46GnxznZD; Sat, 23 Mar 2024 12:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42NC7qPA093477; Sat, 23 Mar 2024 12:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42NC7qhe093474; Sat, 23 Mar 2024 12:07:52 GMT (envelope-from git) Date: Sat, 23 Mar 2024 12:07:52 GMT Message-Id: <202403231207.42NC7qhe093474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 07839ae99c06 - stable/13 - Merge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07839ae99c06fcbebd5da6ead49c160c32046542 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=07839ae99c06fcbebd5da6ead49c160c32046542 commit 07839ae99c06fcbebd5da6ead49c160c32046542 Author: Dimitry Andric AuthorDate: 2024-03-20 22:39:06 +0000 Commit: Dimitry Andric CommitDate: 2024-03-23 12:02:23 +0000 Merge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour): [Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision ResolveConstructorOverload needs to check properly if we are going to use copy elision we can't use a conversion function. This fixes: https://github.com/llvm/llvm-project/issues/39319 https://github.com/llvm/llvm-project/issues/60182 https://github.com/llvm/llvm-project/issues/62157 https://github.com/llvm/llvm-project/issues/64885 https://github.com/llvm/llvm-project/issues/65568 Differential Revision: https://reviews.llvm.org/D148474 This should fix 'Assertion failed: (isa(Val) && "cast() argument of incompatible type!")' errors when building devel/boost-libs, specifically libs/url/src/segments_view.cpp. Bump __FreeBSD_version so this fix can easily be detected from devel/boost-all/compiled.mk. PR: 273335 (cherry picked from commit bcd401b5a39c6186bb1fe450286299f2a481244c) --- contrib/llvm-project/clang/lib/Sema/SemaInit.cpp | 51 +++++++++++----------- .../clang/lib/Sema/SemaTemplateInstantiate.cpp | 4 ++ sys/sys/param.h | 2 +- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Sema/SemaInit.cpp b/contrib/llvm-project/clang/lib/Sema/SemaInit.cpp index 32c9215184eb..1e9078cda26a 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaInit.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaInit.cpp @@ -4092,16 +4092,13 @@ static bool hasCopyOrMoveCtorParam(ASTContext &Ctx, return Ctx.hasSameUnqualifiedType(ParmT, ClassT); } -static OverloadingResult -ResolveConstructorOverload(Sema &S, SourceLocation DeclLoc, - MultiExprArg Args, - OverloadCandidateSet &CandidateSet, - QualType DestType, - DeclContext::lookup_result Ctors, - OverloadCandidateSet::iterator &Best, - bool CopyInitializing, bool AllowExplicit, - bool OnlyListConstructors, bool IsListInit, - bool SecondStepOfCopyInit = false) { +static OverloadingResult ResolveConstructorOverload( + Sema &S, SourceLocation DeclLoc, MultiExprArg Args, + OverloadCandidateSet &CandidateSet, QualType DestType, + DeclContext::lookup_result Ctors, OverloadCandidateSet::iterator &Best, + bool CopyInitializing, bool AllowExplicit, bool OnlyListConstructors, + bool IsListInit, bool RequireActualConstructor, + bool SecondStepOfCopyInit = false) { CandidateSet.clear(OverloadCandidateSet::CSK_InitByConstructor); CandidateSet.setDestAS(DestType.getQualifiers().getAddressSpace()); @@ -4164,7 +4161,7 @@ ResolveConstructorOverload(Sema &S, SourceLocation DeclLoc, // Note: SecondStepOfCopyInit is only ever true in this case when // evaluating whether to produce a C++98 compatibility warning. if (S.getLangOpts().CPlusPlus17 && Args.size() == 1 && - !SecondStepOfCopyInit) { + !RequireActualConstructor && !SecondStepOfCopyInit) { Expr *Initializer = Args[0]; auto *SourceRD = Initializer->getType()->getAsCXXRecordDecl(); if (SourceRD && S.isCompleteType(DeclLoc, Initializer->getType())) { @@ -4232,6 +4229,12 @@ static void TryConstructorInitialization(Sema &S, return; } + bool RequireActualConstructor = + !(Entity.getKind() != InitializedEntity::EK_Base && + Entity.getKind() != InitializedEntity::EK_Delegating && + Entity.getKind() != + InitializedEntity::EK_LambdaToBlockConversionBlockElement); + // C++17 [dcl.init]p17: // - If the initializer expression is a prvalue and the cv-unqualified // version of the source type is the same class as the class of the @@ -4241,11 +4244,7 @@ static void TryConstructorInitialization(Sema &S, // class or delegating to another constructor from a mem-initializer. // ObjC++: Lambda captured by the block in the lambda to block conversion // should avoid copy elision. - if (S.getLangOpts().CPlusPlus17 && - Entity.getKind() != InitializedEntity::EK_Base && - Entity.getKind() != InitializedEntity::EK_Delegating && - Entity.getKind() != - InitializedEntity::EK_LambdaToBlockConversionBlockElement && + if (S.getLangOpts().CPlusPlus17 && !RequireActualConstructor && UnwrappedArgs.size() == 1 && UnwrappedArgs[0]->isPRValue() && S.Context.hasSameUnqualifiedType(UnwrappedArgs[0]->getType(), DestType)) { // Convert qualifications if necessary. @@ -4293,11 +4292,10 @@ static void TryConstructorInitialization(Sema &S, // If the initializer list has no elements and T has a default constructor, // the first phase is omitted. if (!(UnwrappedArgs.empty() && S.LookupDefaultConstructor(DestRecordDecl))) - Result = ResolveConstructorOverload(S, Kind.getLocation(), Args, - CandidateSet, DestType, Ctors, Best, - CopyInitialization, AllowExplicit, - /*OnlyListConstructors=*/true, - IsListInit); + Result = ResolveConstructorOverload( + S, Kind.getLocation(), Args, CandidateSet, DestType, Ctors, Best, + CopyInitialization, AllowExplicit, + /*OnlyListConstructors=*/true, IsListInit, RequireActualConstructor); } // C++11 [over.match.list]p1: @@ -4307,11 +4305,10 @@ static void TryConstructorInitialization(Sema &S, // elements of the initializer list. if (Result == OR_No_Viable_Function) { AsInitializerList = false; - Result = ResolveConstructorOverload(S, Kind.getLocation(), UnwrappedArgs, - CandidateSet, DestType, Ctors, Best, - CopyInitialization, AllowExplicit, - /*OnlyListConstructors=*/false, - IsListInit); + Result = ResolveConstructorOverload( + S, Kind.getLocation(), UnwrappedArgs, CandidateSet, DestType, Ctors, + Best, CopyInitialization, AllowExplicit, + /*OnlyListConstructors=*/false, IsListInit, RequireActualConstructor); } if (Result) { Sequence.SetOverloadFailure( @@ -6776,6 +6773,7 @@ static ExprResult CopyObject(Sema &S, S, Loc, CurInitExpr, CandidateSet, T, Ctors, Best, /*CopyInitializing=*/false, /*AllowExplicit=*/true, /*OnlyListConstructors=*/false, /*IsListInit=*/false, + /*RequireActualConstructor=*/false, /*SecondStepOfCopyInit=*/true)) { case OR_Success: break; @@ -6921,6 +6919,7 @@ static void CheckCXX98CompatAccessibleCopy(Sema &S, S, Loc, CurInitExpr, CandidateSet, CurInitExpr->getType(), Ctors, Best, /*CopyInitializing=*/false, /*AllowExplicit=*/true, /*OnlyListConstructors=*/false, /*IsListInit=*/false, + /*RequireActualConstructor=*/false, /*SecondStepOfCopyInit=*/true); PartialDiagnostic Diag = S.PDiag(diag::warn_cxx98_compat_temp_copy) diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp index 394006a57747..7bf228851de2 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -790,6 +790,10 @@ void Sema::PrintInstantiationStack() { Diags.Report(Active->PointOfInstantiation, diag::note_template_nsdmi_here) << FD << Active->InstantiationRange; + } else if (ClassTemplateDecl *CTD = dyn_cast(D)) { + Diags.Report(Active->PointOfInstantiation, + diag::note_template_class_instantiation_here) + << CTD << Active->InstantiationRange; } else { Diags.Report(Active->PointOfInstantiation, diag::note_template_type_alias_instantiation_here) diff --git a/sys/sys/param.h b/sys/sys/param.h index 77088d010ea6..3065513a8f24 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1303501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1303502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,