This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49508] New: [4.7 Regression] Bogus "control reaches end of non-void function" warning
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Jun 2011 21:11:11 +0000
- Subject: [Bug c++/49508] New: [4.7 Regression] Bogus "control reaches end of non-void function" warning
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: paolo.carlini@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);
}