This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/575: 2.95.2 release does not generate "control reaches end of non-void function" warning with a template class parameter
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/575: 2.95.2 release does not generate "control reaches end of non-void function" warning with a template class parameter
- From: jyke at cs dot tut dot fi
- Date: 28 Sep 2000 11:48:38 -0000
- Reply-To: jyke at cs dot tut dot fi
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, jyke@cs.tut.fi
>Number: 575
>Category: c++
>Synopsis: 2.95.2 release does not generate "control reaches end of non-void function" warning with a template class parameter
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 28 04:56:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Jyke Jokinen <jyke@cs.tut.fi>
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
sparc-sun-solaris2.5.1
>Description:
Running 'g++ -W -Wall -c bug.cc' will correctly give:
bug.cc: In function `int function(Ptr<ClassA>)':
bug.cc:4: warning: control reaches end of non-void function `function(Ptr<ClassA>)'
'g++ -W -Wall -DWRONG -c bug.cc' does not, when
the inline destructor in template class Ptr is not part of the definition.
>How-To-Repeat:
// bug.cc
#include "bug.hh"
int function( Ptr<ClassA> a )
{ a = a; }
// bug.hh
template<class X>
class Ptr
{
public:
Ptr() {};
#ifdef WRONG
~Ptr() {};
#endif
};
class ClassA {};
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.ii"
IyAxICJidWcuY2MiCiMgMSAiYnVnLmhoIiAxCiAKCnRlbXBsYXRlPGNsYXNzIFg+CmNsYXNzIFB0
cgp7CiAgIHB1YmxpYzoKICAgICAgUHRyKCkge307CgogICAgICB+UHRyKCkge307Cgp9OwoKY2xh
c3MgQ2xhc3NBIHt9OwojIDEgImJ1Zy5jYyIgMgoKCmludCBmdW5jdGlvbiggUHRyPENsYXNzQT4g
YSApCnsgYSA9IGE7IH0K