https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78244
Bug ID: 78244 Summary: Narrowing conversion is accepted in a function template, but it should be rejected Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: michele.caini at gmail dot com Target Milestone: --- Consider the following code: auto f() -> decltype(int{0.}, void()) { } int main() { f(); } It fails to compile with the following error: > narrowing conversion of '0.0' from 'double' to 'int' inside { } On the other side, the following function is accepted: template <typename T> auto f(T) -> decltype(int{0.}, void()) { } int main(){ f(0); } Narrowing conversion still present.