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

           Summary: [4.7 Regression] Bogus "control reaches end of
                    non-void function" warning
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: paolo.carl...@oracle.com


In mainline, I see this, apparently bogus, warning which is not emitted by 4.6
(or ICC for that matter). Testcase distilled from 20_util/forward/1_neg.cc in
the v3 testsuite, compile with -Wreturn-type:

template<class T>
  struct shared_ptr
  {
  };

template<class T, class A1, class A2>
  shared_ptr<T>
  factory(const A1&, const A2&)
  {
    return shared_ptr<T>(new T());
  }

struct A
{
  A(int&, int&);
};

void g()
{
  factory<A>(1, 2);
}

Reply via email to