https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81917
Jonathan Wakely changed:
What|Removed |Added
Keywords||ice-on-valid-code
Last reconfirmed|2017-08-22 00:00:00 |2019-6-24
--- Comment #9 from Jonathan Wakely ---
FWIW a user has sent me an ice-on-valid reproducer for this as well. After
reduce it's:
template struct b { static constexpr int c = a; };
template using d = b;
template struct h { template using f = g; };
template using j = i;
template using k = void;
template class l> struct r {
template using f = l;
};
template using aa = typename o::template f;
template struct s {
template using f = aa;
};
template struct t {
template
using f = typename h::template f::template f...>;
};
template struct ab {
template using f = typename o::template f;
};
template struct ac {
template using f = typename o::template f;
};
template using ad = ab, n...>;
struct ae;
struct v {
template using f = t, r>::f;
};
template class, class...>
struct IsValidT_impl {};
template class g, typename... p>
struct IsValidT_impl>, g, p...> : d {};
struct w {
template class g, class... p>
using f = IsValidT_impl;
};
template class ag> struct x {
template using f = ag;
};
template
struct y : aa::template f {
using aj = aa;
aj ak();
};
namespace f {
template using am = decltype(g().ak().an(0, al()));
struct z {
template friend auto operator==(j::c, ae>, g) {}
template friend auto operator==(g, j::c, ae>) {}
};
template struct ao : z {};
} // namespace f
using ap = r;
struct aq {
template auto an(ar at, as au) { return at == au;
}
};
namespace av {
template struct aw : aq {};
} // namespace av
using ax = x;
namespace ay {
template struct az : aa {};
} // namespace ay
using u = x;
namespace ba {
template struct bb : aa {};
} // namespace ba
using bc = x;
struct ae : y {};
int main() {
ae a;
a == 0;
}
This compiles OK since r257542 but still fails with GCC 7:
81917.ii: In instantiation of 'struct IsValidT_impl':
81917.ii:49:37: required by substitution of 'template auto
f::operator==(g, j::c, ae>) [with g = ae]'
81917.ii:72:8: required from here
81917.ii:32:8: error: redefinition of 'struct IsValidT_impl'
struct IsValidT_impl>, g, p...> : d {};
^~
81917.ii:32: confused by earlier errors, bailing out
Is the fix safe to backport to gcc-7-branch?