Skip to content

Commit 2cfef98

Browse files
Fix by using getAtomicUnqualifiedType
1 parent f1b8d34 commit 2cfef98

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15919,17 +15919,10 @@ ExprResult Sema::ActOnStmtExprResult(ExprResult ER) {
1591915919
if (Cast && Cast->getCastKind() == CK_ARCConsumeObject)
1592015920
return Cast->getSubExpr();
1592115921

15922-
auto Ty = E->getType().getUnqualifiedType();
15923-
15924-
// If the type is an atomic, the statement type is the underlying type.
15925-
if (const AtomicType *AT = Ty->getAs<AtomicType>()) {
15926-
Ty = AT->getValueType().getUnqualifiedType();
15927-
return PerformImplicitConversion(E, Ty, AssignmentAction::Casting);
15928-
}
15929-
1593015922
// FIXME: Provide a better location for the initialization.
1593115923
return PerformCopyInitialization(
15932-
InitializedEntity::InitializeStmtExprResult(E->getBeginLoc(), Ty),
15924+
InitializedEntity::InitializeStmtExprResult(
15925+
E->getBeginLoc(), E->getType().getAtomicUnqualifiedType()),
1593315926
SourceLocation(), E);
1593415927
}
1593515928

0 commit comments

Comments
 (0)