From owner-svn-src-all@freebsd.org Wed Jul 8 16:50:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B420E3675FA; Wed, 8 Jul 2020 16:50:48 +0000 (UTC) (envelope-from dim@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B250S48szz4J1s; Wed, 8 Jul 2020 16:50:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5993C23701; Wed, 8 Jul 2020 16:50:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 068Gomhp078186; Wed, 8 Jul 2020 16:50:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 068GolhP078184; Wed, 8 Jul 2020 16:50:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202007081650.068GolhP078184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 8 Jul 2020 16:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363013 - head/contrib/llvm-project/clang/lib/Sema X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Sema X-SVN-Commit-Revision: 363013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:50:48 -0000 Author: dim Date: Wed Jul 8 16:50:47 2020 New Revision: 363013 URL: https://svnweb.freebsd.org/changeset/base/363013 Log: Merge commit 065fc1eafe7c from llvm git (by Richard Smith): PR45521: Preserve the value kind when performing a standard conversion sequence on a glvalue expression. If the sequence is supposed to perform an lvalue-to-rvalue conversion, then one will be specified as the first conversion in the sequence. Otherwise, one should not be invented. This should fix clang crashing with "can't implicitly cast lvalue to rvalue with this cast kind", followed by "UNREACHABLE executed at /usr/src/contrib/llvm-project/clang/lib/Sema/Sema.cpp:538!", when building recent versions of Ceph, and the CPAN module SYBER/Date-5.2.0. Reported by: Willem Jan Withagen , eserte12@yahoo.de PR: 245530, 247812 MFC after: 3 days Modified: head/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp Modified: head/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp Wed Jul 8 16:23:40 2020 (r363012) +++ head/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp Wed Jul 8 16:50:47 2020 (r363013) @@ -4063,8 +4063,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType T break; case ICK_Compatible_Conversion: - From = ImpCastExprToType(From, ToType, CK_NoOp, - VK_RValue, /*BasePath=*/nullptr, CCK).get(); + From = ImpCastExprToType(From, ToType, CK_NoOp, From->getValueKind(), + /*BasePath=*/nullptr, CCK).get(); break; case ICK_Writeback_Conversion: @@ -4303,11 +4303,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType T break; case ICK_Qualification: { - // The qualification keeps the category of the inner expression, unless the - // target type isn't a reference. - ExprValueKind VK = - ToType->isReferenceType() ? From->getValueKind() : VK_RValue; - + ExprValueKind VK = From->getValueKind(); CastKind CK = CK_NoOp; if (ToType->isReferenceType() && Modified: head/contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp Wed Jul 8 16:23:40 2020 (r363012) +++ head/contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp Wed Jul 8 16:50:47 2020 (r363013) @@ -4693,7 +4693,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclTyp Sema::ReferenceConversions::NestedQualification) ? ICK_Qualification : ICK_Identity; - ICS.Standard.FromTypePtr = T2.getAsOpaquePtr(); + ICS.Standard.setFromType(T2); ICS.Standard.setToType(0, T2); ICS.Standard.setToType(1, T1); ICS.Standard.setToType(2, T1);