mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-29 08:08:37 +00:00
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 <wjw@digiware.nl>, eserte12@yahoo.de PR: 245530, 247812 MFC after: 3 days
This commit is contained in:
parent
fcbfdc0ab6
commit
f13e619347
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363013
@ -4063,8 +4063,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
||||
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 ToType,
|
||||
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() &&
|
||||
|
@ -4693,7 +4693,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user