g++ && rtti <typeinfo> problems
M.Cvjetko
cvjetko@rt.e-technik.uni-erlangen.de
Wed Feb 11 02:40:00 GMT 1998
/*
Newsgroups: gnu.g++.bug,gnu.g++.help,gnu.g++.lib.bug
email : egcs-bugs@cygnus.com, bug-g++@prep.ai.mit.edu
Hi!
Sorry for intrusion but I have (again) some misunderstandings
with this example:
*/
# include <typeinfo>
# include <iostream.h>
int main()
{
int i;
typeid(i);
cout << typeid(i).name() << endl:
return 0;
}
/*
with typeinfo **not included**
I get:
Linux :
cvjetko@ft29:/home/cvjet/gcl/example/Tests > uname -a
Linux ft29 2.0.29 #2 Mon Jun 30 14:43:21 MDT 1997 i586 unknown
cvjetko@ft29:/home/cvjet/gcl/example/Tests > g++ -v egcs.2.90_frtti_problems.cpp
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/specs
gcc version egcs-2.91.06 980122 (gcc-2.8.0 release)
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Di386 -D
i586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) egcs.2.90_frtti_problems.cpp /tmp/cca03151.ii
GNU CPP version egcs-2.91.06 980122 (gcc-2.8.0 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++
/usr/local/include
/usr/i586-pc-linux-gnulibc1/include
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/cc1plus /tmp/cca03151.ii -quiet -dumpbase egcs.2.90_frtti_problems.cc -version -o /tmp/cca03151.s
GNU C++ version egcs-2.91.06 980122 (gcc-2.8.0 release) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.06 980122 (gcc-2.8.0 release).
egcs.2.90_frtti_problems.cpp: In function `int main()':
egcs.2.90_frtti_problems.cpp:22: no matching function for call to `type_info::name () const'
egcs.2.90_frtti_problems.cpp:22: parse error before `:'
HPUX:
ft15:gcl/example/Tests[1343]$> uname -a
HP-UX ft15 B.10.20 A 9000/715 2013742512 two-user license
ft15:gcl/example/Tests[1342]$> g++ -v egcs.2.90_frtti_problems.cpp
Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9
k8__ -D__PWB__ -D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa) -D__EXCEPTIONS -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE egcs.2.90_frtti_problems.c
pp /var/tmp/cca20673.ii
GNU CPP version egcs-2.90.23 980102 (egcs-1.0.1 release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++
/usr/local/lib/g++-include
/usr/local/include
/usr/local/hppa1.1-hp-hpux10.20/include
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/cc1plus /var/tmp/cca20673.ii -quiet -dumpbase egcs.2.90_frtti_problems.cc -version -o /var/tmp/cca20673.s
GNU C++ version egcs-2.90.23 980102 (egcs-1.0.1 release) (hppa1.1-hp-hpux10.20) compiled by GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release).
egcs.2.90_frtti_problems.cpp: In function `int main()':
egcs.2.90_frtti_problems.cpp:22: no matching function for call to `type_info::name () const'
egcs.2.90_frtti_problems.cpp:22: parse error before `:'
ft15:gcl/example/Tests[1343]$> uname -a
HP-UX ft15 B.10.20 A 9000/715 2013742512 two-user license
with typeinfo **included**
I get:
Linux :
cvjetko@ft29:/home/cvjet/gcl/example/Tests > uname -a
Linux ft29 2.0.29 #2 Mon Jun 30 14:43:21 MDT 1997 i586 unknown
cvjetko@ft29:/home/cvjet/gcl/example/Tests > g++ -v egcs.2.90_frtti_problems.cpp
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/specs
gcc version egcs-2.91.06 980122 (gcc-2.8.0 release)
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Di386 -D
i586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) egcs.2.90_frtti_problems.cpp /tmp/cca03182.ii
GNU CPP version egcs-2.91.06 980122 (gcc-2.8.0 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++
/usr/local/include
/usr/i586-pc-linux-gnulibc1/include
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.06/cc1plus /tmp/cca03182.ii -quiet -dumpbase egcs.2.90_frtti_problems.cc -version -o /tmp/cca03182.s
GNU C++ version egcs-2.91.06 980122 (gcc-2.8.0 release) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.06 980122 (gcc-2.8.0 release).
In file included from /usr/include/g++/typeinfo:5,
from egcs.2.90_frtti_problems.cpp:12:
/usr/include/g++/std/typeinfo.h:35: declaration of C function `void * __throw_type_match_rtti(void *, void *, void *)' conflicts with
<internal>:35: previous declaration `void * __throw_type_match_rtti(const void *, const void *, void *)' here
In file included from /usr/include/g++/std/typeinfo.h:243,
from /usr/include/g++/typeinfo:5,
from egcs.2.90_frtti_problems.cpp:12:
/usr/include/g++/stdexcept:40: parse error before `{'
/usr/include/g++/stdexcept:44: virtual outside class declaration
/usr/include/g++/stdexcept:44: non-member function `what()' cannot have `const' method qualifier
/usr/include/g++/stdexcept: In function `const char * what()':
/usr/include/g++/stdexcept:44: `_what' undeclared (first use this function)
/usr/include/g++/stdexcept:44: (Each undeclared identifier is reported only once
/usr/include/g++/stdexcept:44: for each function it appears in.)
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:47: base class `logic_error' has incomplete type
/usr/include/g++/stdexcept: In method `domain_error::domain_error(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:49: type `logic_error' is not an immediate basetype for `domain_error'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:52: base class `logic_error' has incomplete type
/usr/include/g++/stdexcept: In method `invalid_argument::invalid_argument(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:54: type `logic_error' is not an immediate basetype for `invalid_argument'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:57: base class `logic_error' has incomplete type
/usr/include/g++/stdexcept: In method `length_error::length_error(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:59: type `logic_error' is not an immediate basetype for `length_error'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:62: base class `logic_error' has incomplete type
/usr/include/g++/stdexcept: In method `out_of_range::out_of_range(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:64: type `logic_error' is not an immediate basetype for `out_of_range'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:67: parse error before `{'
/usr/include/g++/stdexcept:71: virtual outside class declaration
/usr/include/g++/stdexcept:71: non-member function `what()' cannot have `const' method qualifier
/usr/include/g++/stdexcept: In function `const char * what()':
/usr/include/g++/stdexcept:71: redefinition of `const char * what()'
/usr/include/g++/stdexcept:44: `const char * what()' previously defined here
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:72: parse error before `protected'
/usr/include/g++/stdexcept:76: base class `runtime_error' has incomplete type
/usr/include/g++/stdexcept: In method `range_error::range_error(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:78: type `runtime_error' is not an immediate basetype for `range_error'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:81: base class `runtime_error' has incomplete type
/usr/include/g++/stdexcept: In method `overflow_error::overflow_error(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:83: type `runtime_error' is not an immediate basetype for `overflow_error'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:86: base class `runtime_error' has incomplete type
/usr/include/g++/stdexcept: In method `underflow_error::underflow_error(const class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
/usr/include/g++/stdexcept:88: type `runtime_error' is not an immediate basetype for `underflow_error'
/usr/include/g++/stdexcept: At top level:
/usr/include/g++/stdexcept:91: parse error before `}'
egcs.2.90_frtti_problems.cpp: In function `int main()':
egcs.2.90_frtti_problems.cpp:22: parse error before `:'
HPUX:
ft15:gcl/example/Tests[1343]$> uname -a
HP-UX ft15 B.10.20 A 9000/715 2013742512 two-user license
ft05:gcl/example/Tests[1347]$> g++ -v egcs.2.90_frtti_problems.cpp
Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9
k8__ -D__PWB__ -D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa) -D__EXCEPTIONS -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE egcs.2.90_frtti_problems.c
pp /var/tmp/cca20694.ii
GNU CPP version egcs-2.90.23 980102 (egcs-1.0.1 release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++
/usr/local/lib/g++-include
/usr/local/include
/usr/local/hppa1.1-hp-hpux10.20/include
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/cc1plus /var/tmp/cca20694.ii -quiet -dumpbase egcs.2.90_frtti_problems.cc -version -o /var/tmp/cca20694.s
GNU C++ version egcs-2..90.23 980102 (egcs-1.0.1 release) (hppa1.1-hp-hpux10.20) compiled by GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release).
In file included from /usr/local/lib/g++-include/std/typeinfo.h:243,
from /usr/local/lib/g++-include/typeinfo:5,
from egcs.2.90_frtti_problems.cpp:12:
/usr/local/include/g++/stdexcept:40: parse error before `{'
/usr/local/include/g++/stdexcept:44: virtual outside class declaration
/usr/local/include/g++/stdexcept:44: non-member function `what()' cannot have `const' method qualifier
/usr/local/include/g++/stdexcept: In function `const char * what()':
/usr/local/include/g++/stdexcept:44: `_what' undeclared (first use this function)
/usr/local/include/g++/stdexcept:44: (Each undeclared identifier is reported only once
/usr/local/include/g++/stdexcept:44: for each function it appears in.)
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:47: base class `logic_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `domain_error::domain_error(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:49: type `logic_error' is not an immediate basetype for `domain_error'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:52: base class `logic_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `invalid_argument::invalid_argument(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:54: type `logic_error' is not an immediate basetype for `invalid_argument'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:57: base class `logic_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `length_error::length_error(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:59: type `logic_error' is not an immediate basetype for `length_error'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:62: base class `logic_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `out_of_range::out_of_range(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:64: type `logic_error' is not an immediate basetype for `out_of_range'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:67: parse error before `{'
/usr/local/include/g++/stdexcept:71: virtual outside class declaration
/usr/local/include/g++/stdexcept:71: non-member function `what()' cannot have `const' method qualifier
/usr/local/include/g++/stdexcept: In function `const char * what()':
/usr/local/include/g++/stdexcept:71: redefinition of `const char * what()'
/usr/local/include/g++/stdexcept:44: `const char * what()' previously defined here
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:72: parse error before `protected'
/usr/local/include/g++/stdexcept:76: base class `runtime_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `range_error::range_error(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:78: type `runtime_error' is not an immediate basetype for `range_error'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:81: base class `runtime_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `overflow_error::overflow_error(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:83: type `runtime_error' is not an immediate basetype for `overflow_error'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:86: base class `runtime_error' has incomplete type
/usr/local/include/g++/stdexcept: In method `underflow_error::underflow_error(const class basic_string<char,string_char_traits<char> > &)':
/usr/local/include/g++/stdexcept:88: type `runtime_error' is not an immediate basetype for `underflow_error'
/usr/local/include/g++/stdexcept: At top level:
/usr/local/include/g++/stdexcept:91: parse error before `}'
egcs.2.90_frtti_problems.cpp: In function `int main()':
egcs.2.90_frtti_problems.cpp:22: parse error before `:'
Any suggestions?
Thanks a lot
miljenko
*/
More information about the Gcc-bugs
mailing list