[clang] [clang] Fix address spaces on prvalue (PR #221233)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 5 22:17:50 PDT 2026


================
@@ -7682,9 +7682,8 @@ PerformConstructorInitialization(Sema &S,
 
     CurInit = S.CheckForImmediateInvocation(
         CXXTemporaryObjectExpr::Create(
-            S.Context, CalleeDecl,
-            Entity.getType().getNonLValueExprType(S.Context), TSInfo,
-            ConstructorArgs, ParenOrBraceRange, HadMultipleCandidates,
+            S.Context, CalleeDecl, Entity.getType().getNonReferenceType(),
+            TSInfo, ConstructorArgs, ParenOrBraceRange, HadMultipleCandidates,
----------------
tahonermann wrote:

This change has, I think, an observable affect on cases unrelated to address spaces; it looks like temporary materialization will no longer drop other qualifiers like `const` when compiling as C, or in C++ for non-class types. Is that an intentional behavioral change? Or am I misreading the code?

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


More information about the cfe-commits mailing list