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

Alejandro Álvarez Ayllón via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 12 04:58:20 PST 2025


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

> Before you get too far into anything else, could you try just changing the call to getUnqualifiedType() to getAtomicUnqualifiedType() in the original code and seeing if that fixes the problem? That should be fine for the local, short-term fix.

It fixes it, yes, thanks!

(Sorry for the force-push, I saw some seemingly unrelated tests were broken and I wanted to make sure it wasn't due to this, after un-merging `main` [all tests are green](https://buildkite.com/llvm-project/github-pull-requests/builds/146266#_))

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


More information about the cfe-commits mailing list