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++/11939] New: Incorrect warning regression for template class with -Wall option.


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

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

           Summary: Incorrect warning regression for template class with -
                    Wall option.
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raimond_merkert at raytheon dot com
                CC: gcc-bugs at gcc dot gnu dot org

GCC 3.4 generates a warning when I think it should not. This is different from
3.3.1. 

The warning is: 

test.cpp: In member function `virtual int X<T>::foo()':
test.cpp:10: warning: no return statement in function returning non-void

for this program:
cat >> test.cpp <<EOF
template <class T>
struct X
{
  virtual int foo() throw (double)
  { throw 1.0; }
};
EOF

gcc -c -Wall test.cpp

This error only happens if X is a template class. The GCC 3.4 build is
gcc-3.4-20030813.


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