egcs 1.1b bogus warning?

Trevor Taylor ttaylor@powerup.com.au
Sun Oct 18 05:34:00 GMT 1998


Hi,

The attached code, when compiled, gives:


gcc -g -I../out/ -I. -c xxx.cxx -o ../out/xxx.o
xxx.cxx:34: warning: declaration of `A<T>::X()' throws different
exceptions
xxx.cxx:29: warning: previous declaration here

+ gcc -g -I../out/ -I. -L../out/ ../out/xxx.o -lstdc++ -o ../out/xxx


I think the code is correct (i.e. X() throws the same exceptions).



Here is the output of gcc -v:

Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)


Cheers,

Trevor
//     -*- mode: c++ ; c-file-style: "osse" ; -*-
//
// Copyright (c) 1998
// Trevor Taylor
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all.
// Trevor Taylor makes no representations about the suitability of this
// software for any purpose.  It is provided "as is" without express or
// implied warranty.
//
//  MODULE:  
//  
//    $Id$
//
//  ABSTRACT:
//
//    EGCS 1.1b compiler bug report.
//
static const char rcsid[] = "$RCSfile: twt_cxx.el,v $ $Revision: 1.6 $";



template<class T>
class A
{
public:
    void X() throw(T);
};

template<class T>
inline void A<T>::X() throw(T)
{
}


int main(int argc, char* argv[])
{
    A<int> a;
    return 0;
}



More information about the Gcc-bugs mailing list