[Bug c++/78244] Narrowing conversion is accepted in a function template, but it should be rejected

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 13 22:13:00 GMT 2018


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

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Testcase from 88012:

using Number = unsigned int;

template <int>
struct S {
  S() {
    const Number x = {-1};
    (void)x;
  }
};

int main()
{
  S<1> s;
}


More information about the Gcc-bugs mailing list