internal compiler arror in fold_convert_loc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-7 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
gcc-9 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
With the build of GCC available in ubuntu 18.04, I get the following error when trying to compile this code:
// minimal example to break gcc 7 in the same way that the reflect code breaks it
#include <type_traits>
template<class T, class R, class ... ARGS>
struct MemberPointer
{
R (T::* ptr)(ARGS...);
};
template<class T, class R, class ... ARGS>
constexpr MemberPointer<T, R, ARGS...> makeMemberPoint
{
return {ptr};
}
struct Foo
{
static constexpr auto getField(
{
// This line breaks gcc
return makeMemberPoint
// This line does not break gcc
//return makeMemberPoint
}
void foo(){}
};
template<class T>
struct Wrapper
{
template<int I>
static constexpr auto getField()
{
return T::getField(
}
};
int main()
{
// This line works fine either way
Foo::
// The offending line only breaks gcc when called through the Wrapper class
Wrapper<
}
error:
internal compiler error: in fold_convert_loc, at fold-const.c:2530
return T::getField(
Interestingly enough this bug is not present when I put this code into godbolt (https:/
The different flags between godbolt and ubuntu's built of gcc are as follows:
godbolt:
Configured with: ../gcc-
ubuntu:
Configured with: ../src/configure -v --with-
description: | updated |
description: | updated |
Changed in gcc-9 (Ubuntu): | |
status: | New → Fix Released |
seen in GCC 6, 7, 8, not seen in GCC 9