[Bug c++/19699] New: [4.0 Regression] warning about not returning from end of a non-void function because of dead code

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 29 19:22:00 GMT 2005


Reduced testcase (why don't we remove the dead code before inlining).
void g(void);
inline int f(void)
{
  return 1;
  g();
}
int h(void)
{
  return f();
}

Note this is reduced from:
#include <string>
#include <vector>
void foo(std::vector<std::string> & matches)
{
 char * buf[10];
 matches.insert(matches.end(), buf, buf + 10);
}

(also why does libstdc++ have dead code in its headers.

-- 
           Summary: [4.0 Regression] warning about not returning from end of
                    a non-void function because of dead code
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19699



More information about the Gcc-bugs mailing list