[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 12:09:46 PST 2025


Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/119711 at github.com>


================
@@ -15919,10 +15919,17 @@ ExprResult Sema::ActOnStmtExprResult(ExprResult ER) {
   if (Cast && Cast->getCastKind() == CK_ARCConsumeObject)
     return Cast->getSubExpr();
 
+  auto Ty = E->getType().getUnqualifiedType();
----------------
AaronBallman wrote:

What I'm confused by is actually a few lines farther up. Why do we not want to do an lvalue-to-rvalue conversion when the result of the statement expression is an rvalue? That conversion would strip all the qualifiers, including the atomic ones, which seems like exactly the behavior we want.

That comment comes from https://github.com/llvm/llvm-project/commit/34376a68

CC @rjmccall in case you have some recollection here.

https://github.com/llvm/llvm-project/pull/119711


More information about the cfe-commits mailing list