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]

egcs-1.1b still allows to create abstract objects.


Hello;

I already sent these files as bug reports for egcs-1.0.[23].
Just installed egcs-1.1b, but bug(s) remains. So I report once
more.

osv@osv$ cat abstract.cc
class A {
public:
  A(int);
  virtual void foo() const = 0;
};

void f(A const& a) {
  a.foo();
}

void test() {
  // To satisfy this call the object of abstract
  // class should be created. This just shouldn't
  // compile, isn't it?
  f(10);
}
osv@osv$ cat abstract1.cc
class A {
public:
  virtual void foo() const = 0;
};

A a[1]; // Should generate error
osv@osv$ ~/local/bin/g++ -W -Wall -c abstract.cc
osv@osv$ ~/local/bin/g++ -W -Wall -c abstract1.cc
osv@osv$ ~/local/bin/g++ -W -Wall -c -v abstract1.cc
Reading specs from
/home/osv/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /home/osv/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/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 -W -Wall
-Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__
abstract1.cc /tmp/cceyU53q.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /home/osv/local/include/g++
 /usr/local/include
 /home/osv/local/i586-pc-linux-gnulibc1/include
 /home/osv/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/include
 /usr/include
End of search list.
 /home/osv/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57/cc1plus
/tmp/cceyU53q.ii -quiet -dumpbase abstract1.cc -W -Wall -version -o
/tmp/ccqsp2nJ.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(i586-pc-linux-gnulibc1) compiled by GNU C version 2.7.2.1.
 /home/osv/local/i586-pc-linux-gnulibc1/bin/as -V -Qy -o abstract1.o
/tmp/ccqsp2nJ.s
GNU assembler version 971211 (i586-pc-linux-gnulibc1), using BFD version
971211
osv@osv$ 

Hope it helps;

Regards,
Sergei Organov.


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