https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104823
Bug ID: 104823
Summary: [12 Regression] narrowing conversion inside
non-dependent decltype operand silently accepted ever
since r12-6075
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ppalka at gcc dot gnu.org
Target Milestone: ---
struct S { S(int); };
int id(int v);
double id(double v);
template<class> auto f(double v) -> decltype(S{id(v)});
GCC 11 correctly issues a narrowing conversion warning for this testcase ever
since r11-434:
<stdin>:6:50: warning: narrowing conversion of ‘id(v)’ from ‘double’ to ‘int’
[-Wnarrowing]
But in GCC 12 the warning is gone.