https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107332
Bug ID: 107332
Summary: internal compiler error: in tsubst_copy, at
cp/pt.c:15751
Product: gcc
Version: 9.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dreamcooled at gmail dot com
Target Milestone: ---
I'm getting an ICE when compiling the following program on x86-64 gcc 9.5.
Tried it on godbolt.org with -std=c++17 command line options.
The bug seems to be fixed in > gcc 10.
#include
template void Invoke()
{
auto f = [](auto stateIdIntegralConstant) {
if constexpr
(std::integral_constant() == 0)
{
}
};
f(std::integral_constant{});
}
int main()
{
Invoke();
}
Compiler output:
: In instantiation of 'Invoke() [with T = int]:: [with
auto:1 = std::integral_constant]':
:10:6: required from 'void Invoke() [with T = int]'
:15:16: required from here
:6:28: internal compiler error: in tsubst_copy, at cp/pt.c:15751
6 | if constexpr
(std::integral_constant() == 0)
|
^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
I see there are possible duplicates of this bug, but all are in state
resolved/fixed and I'm not sure if it is really the same bug.
If it is the same bug, I was hoping that the fix could be backported to gcc 9,
since I'm using only standard c++17 without any experimental features...
Thank You.