ICE in getLambdaCallOperatorHelper · Issue #137014 · llvm/llvm-project (original) (raw)
The following reduced code ICEs clang 20.1.
template < template < typename> typename> struct TypeTList; template < typename > constexpr auto LambdaThing = []< template < typename> typename... Args >( TypeTList< Args... > ) {}; template < template < typename > typename TheThingT, typename TheParam > struct TraitApplier { template < typename > using X = TheThingT< TheParam >; }; template < typename Traits > concept FooTraitsConcept = requires { LambdaThing< typename Traits::FooTypes >; }; template < FooTraitsConcept > class Foo; struct FooTraits { using FooTypes = int; }; void foo() { TraitApplier< Foo, FooTraits> x; }
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: /opt/compiler-explorer/clang-20.1.0/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-14.2.0 -fcolor-diagnostics -fno-crash-diagnostics -std=c++23 <source>
1. <source>:19:36: current parser token ';'
2. <source>🔞12: parsing function body 'foo'
3. <source>🔞12: in compound statement ('{}')
4. <source>:5:8: instantiating class definition 'TraitApplier<Foo, FooTraits>'
#0 0x0000000003a59568 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-20.1.0/bin/clang+++0x3a59568)
#1 0x0000000003a576ac llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-20.1.0/bin/clang+++0x3a576ac)
#2 0x00000000039a69e8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007235a6442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x0000000007375203 getLambdaCallOperatorHelper(clang::CXXRecordDecl const&) (.part.0) DeclCXX.cpp:0:0
#5 0x00000000073760db clang::CXXRecordDecl::getLambdaCallOperator() const (/opt/compiler-explorer/clang-20.1.0/bin/clang+++0x73760db)
......
https://godbolt.org/z/qnGbPzTKv
This appears to be a clang 20.x regression.