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]

c++/575: 2.95.2 release does not generate "control reaches end of non-void function" warning with a template class parameter



>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

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