https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/228352
>From fe35885bed400eb2281f5a68e990c8ec85342956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Fri, 2 Oct 2026 09:26:50 +0200 Subject: [PATCH] [clang][bytecode] Handle trivial CXXInheritedCtorInitExprs --- clang/lib/AST/ByteCode/Compiler.cpp | 6 ++++-- clang/test/AST/ByteCode/cxx26.cpp | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 42859942d2925c..83cd4c65b33f0b 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -4245,8 +4245,10 @@ template <class Emitter> bool Compiler<Emitter>::VisitCXXInheritedCtorInitExpr( const CXXInheritedCtorInitExpr *E) { const CXXConstructorDecl *Ctor = E->getConstructor(); - assert(!Ctor->isTrivial() && - "Trivial CXXInheritedCtorInitExpr, implement. (possible?)"); + + if (Ctor->isTrivial()) + return true; + const Function *F = this->getFunction(Ctor); if (!F) return false; diff --git a/clang/test/AST/ByteCode/cxx26.cpp b/clang/test/AST/ByteCode/cxx26.cpp index 68da8bae0e9463..fae162b2c741f7 100644 --- a/clang/test/AST/ByteCode/cxx26.cpp +++ b/clang/test/AST/ByteCode/cxx26.cpp @@ -159,3 +159,12 @@ namespace TrivialAssignment { // both-note {{in call to}} } + +namespace TrivialInheritedCtor { + struct S {}; + template<typename T> struct D : S { + D() requires (sizeof(T) > sizeof(char)); + using S::S; + }; + D<char> d; +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
