<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69979>69979</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Assertion `AllowOversized && "Elems are oversized"' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
berolinux
</td>
</tr>
</table>
<pre>
Trying to build the following code with clang 17.0.3
```
class a {
public:
typedef char b[41];
};
struct c {
const a::b &d;
};
static void fn1() { static c e{"9cd4858014c4e8a9dff96053f784bfaac1092a2e"}; }
void f() { (void)fn1; }
```
Results in
```
clang-17: /builddir/build/BUILD/llvm-project-17.0.3.src/clang/lib/CodeGen/CGExprConstant.cpp:448: static llvm::Constant *(anonymous namespace)::ConstantAggregateBuilder::buildFrom(CodeGenModule &, ArrayRef<llvm::Constant *>, ArrayRef<CharUnits>, CharUnits, CharUnits, bool, llvm::Type *, bool): Assertion `AllowOversized && "Elems are oversized"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/bin/clang-17 -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -dumpdir a- -disable-free -clear-ast-before-backend -main-file-name ROMInfo-662a72.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp -resource-dir /usr/lib64/clang/17 -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/13.1.1/../../../../include/c++/13.1.1 -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/13.1.1/../../../../include/c++/13.1.1/x86_64-openmandriva-linux-gnu -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/13.1.1/../../../../include/c++/13.1.1/backward -internal-isystem /usr/lib64/clang/17/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/13.1.1/../../../../x86_64-openmandriva-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/tmp -ferror-limit 19 -fgnuc-version=13.1.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/ROMInfo-662a72-8757bc.o -x c++ ROMInfo-662a72.cpp
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. ROMInfo-662a72.cpp:8:13: Generating code for declaration 'fn1'
#0 0x00007fb0cea9a686 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM-17.so+0x489a686)
#1 0x00007fb0cea992fa llvm::sys::RunSignalHandlers() (/lib64/libLLVM-17.so+0x48992fa)
#2 0x00007fb0cea99fa4 (/lib64/libLLVM-17.so+0x4899fa4)
#3 0x00007fb0c9c556f0 (/lib64/libc.so.6+0x3d6f0)
#4 0x00007fb0c9ca49bc (/lib64/libc.so.6+0x8c9bc)
#5 0x00007fb0c9c55642 gsignal (/lib64/libc.so.6+0x3d642)
#6 0x00007fb0c9c3e4ad abort (/lib64/libc.so.6+0x264ad)
#7 0x00007fb0c9c3e3d5 (/lib64/libc.so.6+0x263d5)
#8 0x00007fb0c9c4e042 (/lib64/libc.so.6+0x36042)
#9 0x00007fb0d697d2d6 (/lib64/libclang-cpp.so.17+0x2d7d2d6)
#10 0x00007fb0d697c1f8 (/lib64/libclang-cpp.so.17+0x2d7c1f8)
#11 0x00007fb0d6987445 (/lib64/libclang-cpp.so.17+0x2d87445)
#12 0x00007fb0d6978ec7 clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl const&) (/lib64/libclang-cpp.so.17+0x2d78ec7)
#13 0x00007fb0d690c077 clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(clang::VarDecl const&, llvm::GlobalVariable*) (/lib64/libclang-cpp.so.17+0x2d0c077)
#14 0x00007fb0d68fe4fe clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(clang::VarDecl const&, llvm::GlobalValue::LinkageTypes) (/lib64/libclang-cpp.so.17+0x2cfe4fe)
#15 0x00007fb0d68fdc6d clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (/lib64/libclang-cpp.so.17+0x2cfdc6d)
#16 0x00007fb0d6aecabb clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) (/lib64/libclang-cpp.so.17+0x2eecabb)
#17 0x00007fb0d6adba5e clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/lib64/libclang-cpp.so.17+0x2edba5e)
#18 0x00007fb0d6ada2ff clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/lib64/libclang-cpp.so.17+0x2eda2ff)
#19 0x00007fb0d6b66111 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/lib64/libclang-cpp.so.17+0x2f66111)
#20 0x00007fb0d6b6737b clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/lib64/libclang-cpp.so.17+0x2f6737b)
#21 0x00007fb0d6baf27e clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/lib64/libclang-cpp.so.17+0x2faf27e)
#22 0x00007fb0d6bae6fa clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/lib64/libclang-cpp.so.17+0x2fae6fa)
#23 0x00007fb0d6b7dac0 clang::CodeGen::CodeGenModule::EmitDeferred() (/lib64/libclang-cpp.so.17+0x2f7dac0)
#24 0x00007fb0d6b7af9b clang::CodeGen::CodeGenModule::Release() (/lib64/libclang-cpp.so.17+0x2f7af9b)
#25 0x00007fb0d6c3e249 (/lib64/libclang-cpp.so.17+0x303e249)
#26 0x00007fb0d6b58920 (/lib64/libclang-cpp.so.17+0x2f58920)
#27 0x00007fb0d525aaa6 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.17+0x165aaa6)
#28 0x00007fb0d763a52b clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.17+0x3a3a52b)
#29 0x00007fb0d75a1279 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.17+0x39a1279)
#30 0x00007fb0d76b4cb9 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.17+0x3ab4cb9)
#31 0x000056113a0b6671 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-17+0x16671)
#32 0x000056113a0b2e50 (/usr/bin/clang-17+0x12e50)
#33 0x000056113a0b16e1 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-17+0x116e1)
#34 0x000056113a0c1442 main (/usr/bin/clang-17+0x21442)
#35 0x00007fb0c9c3fc0a (/lib64/libc.so.6+0x27c0a)
#36 0x00007fb0c9c3fcc5 __libc_start_main (/lib64/libc.so.6+0x27cc5)
#37 0x000056113a0aef11 _start (/usr/bin/clang-17+0xef11)
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
OpenMandriva 17.0.3-2 clang version 17.0.3 (/builddir/build/BUILD/llvm-project-17.0.3.src/clang 18809a70981537fd3c6cb756a026b7ecbbdfe2bd)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/ROMInfo-662a72-69443c.cpp
clang: note: diagnostic msg: /tmp/ROMInfo-662a72-69443c.sh
clang: note: diagnostic msg:
********************
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWltP5Li2_jXhxXIpcVK5PPBQUBSNRJ9GwPR-RI69ErwnsSPb6Yb964_spKhycWfmnD0tBImz_K3v87KXb02NEa0EOI6WJ9FyfURHe6_0cQ1adUKOD0e14o_Ht_pRyBZZhepRdBzZe0CN6jr12xUzxQH9FvYesY7KFiXFIl6kUbyO4tX8O4_nH__KOmoMoigqTqaCYaw7waJ0NkfIPg7AoUHsnmpUR8uTLImW6yid7aNi92ysHplFbIeGEFPSWEQdYLqqUURy_kpdagVDv5TgqJFJRMqIVA4IzV8YAgdLSMV4Vi7LOMlYBiWteNNUebxMm6LM6oZSlsQVoQQiQiYHyP3xTib0PeyIlK4sIpXzuW960E7T72swY2cNEvLtJpUtToooXaGIbHyYuNDbx4hsTv64uFxHZNN1v3o8aPVvYBZPoVoYzSKy8RjOQtQR2ZwqDucg3dP52cOgT12bUmkXbBiidJVlpfM1t5MDnVp7a4YisopISaWSj70aDZK0BzNQBhGpQtNV22poqYUTRxX0HDb3stGqj0g5c_mu-NiBC2dETtFKa_p4DU2Unr7iPj07sDu9p_oPKayZP-3eD19qpTr3d4d8-zjAJGr71clAK2NAW6EkivJ45YbEj1-gjfgP8IlojiJCzjroDaIakNp-dT2FFKihogO-mKJ4dXm2ujlDZqx7YRFF9dgiDYPS1o29e2sH48iQTUQ2rbD3Y71groF8UA9iG5GNMGYEE5ENopIjIVk3cvCDl2lq7lFN2Z9W-5CcokHDoBUDY4Ajo0Y9Fbua1BjFBLXAkR4lMkyLwc6UbyxlfyI-9sPT8I0X6EqrVtMeUd2OPUjX4L5fjsZ3SSG33Q0nBcKMJQhbLYYO0EOZ3-UZHhj2-Qe3ckQYemGxqv-NcK-how-Ydh3CzikXGlGMMBeG1h3gRgMgzDqgGlNjcQ2N0oCdUpAc4Z4KiRvRAXb9EV3_-H4hG4XznNCCuK49uVCMup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