[clang] 492b609 - [clang][bytecode] Remove bogus Initializing special case (#159933)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 23 03:55:52 PDT 2025


Author: Timm Baeder
Date: 2025-09-23T12:55:48+02:00
New Revision: 492b60937bcdda3f7f834bdd73e893479549d6b5

URL: https://github.com/llvm/llvm-project/commit/492b60937bcdda3f7f834bdd73e893479549d6b5
DIFF: https://github.com/llvm/llvm-project/commit/492b60937bcdda3f7f834bdd73e893479549d6b5.diff

LOG: [clang][bytecode] Remove bogus Initializing special case (#159933)

This doesn't seem to be needed anymore and causes problems.

Fixes #159787

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Compiler.cpp
    clang/test/AST/ByteCode/cxx03.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 7518cfd2cf94d..b4da99957ee88 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -2383,13 +2383,8 @@ bool Compiler<Emitter>::VisitMemberExpr(const MemberExpr *E) {
     return this->visitDeclRef(Member, E);
   }
 
-  if (Initializing) {
-    if (!this->delegate(Base))
-      return false;
-  } else {
-    if (!this->visit(Base))
-      return false;
-  }
+  if (!this->visit(Base))
+    return false;
 
   // Base above gives us a pointer on the stack.
   const auto *FD = cast<FieldDecl>(Member);

diff  --git a/clang/test/AST/ByteCode/cxx03.cpp b/clang/test/AST/ByteCode/cxx03.cpp
index 10e5232b9f873..58d7f3632082d 100644
--- a/clang/test/AST/ByteCode/cxx03.cpp
+++ b/clang/test/AST/ByteCode/cxx03.cpp
@@ -40,3 +40,9 @@ struct B2 : B {
 };
 _Static_assert(&(B2().a) == &p, ""); // both-error {{taking the address of a temporary object of type 'int'}} \
                                      // both-error {{not an integral constant expression}}
+
+typedef __attribute__((ext_vector_type(4))) int vi4b;
+struct S {
+  vi4b w;
+};
+const int s = S().w[1];


        


More information about the cfe-commits mailing list