This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12504] New: [REGRESSION] incorrect warning of missing return statement


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [REGRESSION] incorrect warning of missing return
                    statement
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: merkert at charter dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: g++ (GCC) 3.4 20031001 (experimental)

The following code prints a warning:

cat > test.cpp <<EOF
template <class T> int foo()
{ throw 0; }
EOF
g++ -c -Wall test.cpp
test.cpp: In function `int foo()':
test.cpp:2: warning: no return statement in function returning non-void

This code compiles fine with gcc-3.3.1, so it's a regression.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]