You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang crash in CodeGen with C++20 modules: auto member function of a class template
Clang segfaults during IR generation on valid code. CodeGen emits a call to Inner<unsigned long>::size(), but on the declaration it uses, the auto return type
was never deduced. Clang then reads a null type while classifying the return type.
Details
Reproduction on godbolt:
trunk https://godbolt.org/z/Kr1YdG5dd
23.1.0: https://godbolt.org/z/z9vr9PW4v
Below is the explanation from AI
Clang crash in CodeGen with C++20 modules: auto member function of a class template
Clang segfaults during IR generation on valid code. CodeGen emits a call to Inner<unsigned long>::size(), but on the declaration it uses, the auto return type
was never deduced. Clang then reads a null type while classifying the return type.
Activity
llvmorg-github-actions commentedon Nov 12, 2026
@llvm/issue-subscribers-clang-modules
Author: Denis Yaroshevskiy (DenisYaroshevskiy)
Details
Reproduction on godbolt: trunk https://godbolt.org/z/Kr1YdG5dd 23.1.0: https://godbolt.org/z/z9vr9PW4vBelow is the explanation from AI
Clang crash in CodeGen with C++20 modules:
automember function of a class templateClang segfaults during IR generation on valid code. CodeGen emits a call to
Inner<unsigned long>::size(), but on the declaration it uses, theautoreturn typewas never deduced. Clang then reads a null type while classifying the return type.
Godbolt: <link>
Reproducer
CMakeLists.txt
table.cppm
use_size.cppm
holder.cppm
user.cppm
main.cpp
Crash
Explicit return types for size/chunkShift/chunkCount to work around a…