https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81236

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #3)
> (In reply to Guillaume Racicot from comment #0)
> > This code is valid and compiles under clang (3.8.0)
> 
> It isn't valid; with make_crash<i> you're trying to use a function parameter
> as a non-type template argument.

Oops, I wasn't noticing the integral_constant type; the testcase isn't actually
trying to use i as an rvalue.  So it's more like

template <int I> void f();
struct A { constexpr operator int() { return 24; } };
template <class T> constexpr void g(T t)
{
  f<t>();
}

int main()
{
  g(A());
}

Reply via email to