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

            Bug ID: 99795
           Summary: -Wnarrowing/-Woverflow false-negative in constant
                    expression in undeduced context
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nok.raven at gmail dot com
                CC: jason at redhat dot com, mpolacek at gcc dot gnu.org
  Target Milestone: ---

template <char N> struct X {};
template <class T> X<sizeof(T)> foo();
int x = sizeof(foo<char[512]>());

template <typename T>
struct bar { typedef X<sizeof(T)> t; };
bar<char[512]> y;


GCC 4.6-6 had an -Woverflow warning here; since GCC 7 -Wconversion warning was
emitted instead, but since bug 99331 is fixed there is no warning at all.

Reply via email to