This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28424] New: Missing return statement in template function don't cause compiler error
- From: "doomtr666 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2006 18:04:18 -0000
- Subject: [Bug c++/28424] New: Missing return statement in template function don't cause compiler error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In template function, g++ compiler does not detect missing return statement:
This part of code causes the problem:
#include <iostream>
template <typename P1>
int testFunc(P1 p)
{
}
int main()
{
float f = 0;
std::cout << testFunc(f) << std::endl;
}
g++ command line:
$ g++ test.cpp
(no output)
Test execution:
$./a.out
1094713344
G++ version:
$ g++ --version
g++ (GCC) 4.0.0 20060507 (prerelease) (Debian 4.0.3-3)
--
Summary: Missing return statement in template function don't
cause compiler error
Product: gcc
Version: 4.0.4
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: doomtr666 at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28424