[Bug c++/90426] [P0732] Error constructing non-type template parameter from a prvalue

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 10 21:49:00 GMT 2019


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think this is invalid.  [temp.arg]p2:
"In a template-argument, an ambiguity between a type-id and an expression is
resolved to a type-id, regardless of the form of the corresponding
template-parameter."

template<auto>
struct S { };

struct R { };

void
g (void)
{
  S<R()> s; // template argument treated as function type
  S<R{}> s2;
  S<int()> s3; // template argument treated as function type
  S<int{}> s4;
}


More information about the Gcc-bugs mailing list