https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123290
Bug ID: 123290
Summary: Internal compiler error when lamda is used as template
argument
Product: gcc
Version: 15.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vorfeed.canal at gmail dot com
Target Milestone: ---
Created attachment 63149
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63149&action=edit
Full sources for the reference
The code that's triggering internal compiler error looks like this:
using OutputType = TypesToTypes::FlatMap<std::tuple<Args...>,
[]<typename Type>() {
if constexpr (std::is_lvalue_reference_v<Type>) {
return kMetaTypes<std::remove_reference_t<Type>>;
} else {
return kMetaTypes<>;
}
}>;
What's weird is that tiny adjustments of the source make code work or explode
spectacularly. But it works with clang and Microsoft's compilers:
https://godbolt.org/z/nTz4arY4n