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]

syntax error not detected



Hello,

here is an "illegal" c++-program, which does not cause any warning
or compilation error.

Daniel <hempel@zib.de>


Compilation:
g++ -ansi -Wall file.cc

file.cc
------------------------------------------------------------------------------
 #include <iostream.h>

 class A
 {
   A() { cout << "private default constructor (never called)\n"; }
 public:
   
   A(const A &src)
   {
     if(&src == this)
       cout << "Big bang: constructing me by myself\n";
   }
 };

 int main(void)
 {
   A a = a;
   return 0;
 }
------------------------------------------------------------------------------

gcc -v
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)

uname -a
Linux hermesbaby 2.0.35 #38 Wed Feb 10 16:11:02 CET 1999 i586 unknown

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