From nobody Mon May 30 18:30:32 2022 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 EEABF1B4C26C; Mon, 30 May 2022 18:30:32 +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 4LBkVc45y9z3HlJ; Mon, 30 May 2022 18:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653935432; 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=yKicoc6nSvuf8XKeFAmt0y23Ir8Az4QbEZTTEwWart8=; b=H8FRhYkNMMWni1SPKlqFJ5YoYOIKOCJHNgbhBxkiHSdNFVMxRtxrqcEfrOuxwyoeSRLXwo mmAb5oyPnRPU8gjoVpxLAUdKmO2sl6BvmbJw5FBWDiznN/yZdJPA47vUEj0V2p1xEb4qRl 3zBk+Yt73qVPtkibXYJgdTcjyWN+IfnANkF/mi+7vXVuoZfD5hH26/lK3LR/q984/Ylz8x LjZiubYfnsBExY1UtkNy8i/Pne9i1A1j2s00hoDH5hbUhLoj5R/WuQHjSbKPs8Sn8S5TqK K8YhfWHoTPgcbkDfIaDMu4yBK166onnoKGWPKfpRjI3B+1d81enIQIMK9kFKQg== 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 466041C3DD; Mon, 30 May 2022 18:30:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24UIUWeJ084161; Mon, 30 May 2022 18:30:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24UIUW7q084160; Mon, 30 May 2022 18:30:32 GMT (envelope-from git) Date: Mon, 30 May 2022 18:30:32 GMT Message-Id: <202205301830.24UIUW7q084160@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: 34c1a831bb1f - stable/13 - Apply clang fix for assertion failure building webkit2-gtk 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: 34c1a831bb1f2bfbbf1b2d343c1e653e5df1d96a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653935432; 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=yKicoc6nSvuf8XKeFAmt0y23Ir8Az4QbEZTTEwWart8=; b=DGQz/sUdill2ktnH0FpuvokK8KFZT8SCf1VyrejPJDZjLL6tvvuH44rIzyaV31SZTVCIcc Yj5NsdCev2daEWXsqD7ULs0oSdNKouqsZiTrnWKidVWTyFjIRVyCGgfWFJWZCYaSXLWJEv Oikt0DdVtSXS7N4KGVrnZs0S+DxXUoUsOQxVnrsO4dM+NiUj4c9+8IxZKrAf3V7Ly6PSPw UzBMZTlKAkE2oLU6q5CDYAvwom1jTNY5hspyyCN2caRLikJiQH8YKAb7PImxNUpa7qR6Xf JCiO8vEv3vtSjx4hRQcZGMibW30Ze/QCVh2HT3XvT36rCxAaTrx9govZzbgliQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653935432; a=rsa-sha256; cv=none; b=tq5qO/RHxOxvUxKYRoGHBJiz6qMqmwFoygYlOhKOvStJUph0JvV9jkDJDOUzqIqXfHerTY 8ZSGCVVMtS3hms4aJKhgXCYn2tML4nWCHgBc3v2YV6B5HHvpY8JqozO3X3Qe0tmGKsB0vu QCs7GWqlp51tbrsTMZ9BvIBwhGzCKUIu6wgCoMzzoJQ3MVwm18ugSJ1NzcJhAG/ekLdgF0 yn72EPBE4xcSm/wtiIzUu+v779MVjOKu+fQA5ihF2wt+bP4+NGXMOD30ui0IfDcFtrIsWU 4bQQQj93RP9RE/ShGVidqUmTs8KaQ8/SwUfNV8s4UDraupL8NtVmYwSpFFL0xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=34c1a831bb1f2bfbbf1b2d343c1e653e5df1d96a commit 34c1a831bb1f2bfbbf1b2d343c1e653e5df1d96a Author: Dimitry Andric AuthorDate: 2022-05-27 17:43:39 +0000 Commit: Dimitry Andric CommitDate: 2022-05-30 18:28:33 +0000 Apply clang fix for assertion failure building webkit2-gtk Merge commit 30baa5d2a450 from llvm git (by Richard Smith): PR45879: Fix assert when constant evaluating union assignment. Consider the form of the first operand of a class assignment not the second operand when implicitly starting the lifetimes of union members. Also add a missing check that the assignment call actually came from a syntactic assignment, not from a direct call to `operator=`. PR: 264280 Reported by: bapt MFC after: 3 days (cherry picked from commit eca6e0f7e460bf9a4a6e1bd5198d75168280c88e) --- contrib/llvm-project/clang/lib/AST/ExprConstant.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp index ba2865d66e0a..8cdef3c3fa04 100644 --- a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp +++ b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp @@ -6097,9 +6097,6 @@ static bool HandleFunctionCall(SourceLocation CallLoc, if (!handleTrivialCopy(Info, MD->getParamDecl(0), Args[0], RHSValue, MD->getParent()->isUnion())) return false; - if (Info.getLangOpts().CPlusPlus20 && MD->isTrivial() && - !HandleUnionActiveMemberChange(Info, Args[0], *This)) - return false; if (!handleAssignment(Info, Args[0], *This, MD->getThisType(), RHSValue)) return false; @@ -7611,6 +7608,15 @@ public: if (!EvaluateObjectArgument(Info, Args[0], ThisVal)) return false; This = &ThisVal; + + // If this is syntactically a simple assignment using a trivial + // assignment operator, start the lifetimes of union members as needed, + // per C++20 [class.union]5. + if (Info.getLangOpts().CPlusPlus20 && OCE && + OCE->getOperator() == OO_Equal && MD->isTrivial() && + !HandleUnionActiveMemberChange(Info, Args[0], ThisVal)) + return false; + Args = Args.slice(1); } else if (MD && MD->isLambdaStaticInvoker()) { // Map the static invoker for the lambda back to the call operator.