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-2.91.43: error for valid c++ code


Hello,
I am not 100% sure, but I think the code below is valid C++ code. egcs gives an
error message.

uname -a: SunOS zeal 5.5 Generic sun4u sparc SUNW,Ultra-1 

***** Program source:



class Y {
public:
  void operator +(int) const;
};

namespace X {
  extern Y const& z;
}

void f(void) {
  X::z + 1;
}



***** Compilation:


Reading specs from
/home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/specs
gcc version egcs-gmake[1]: Leaving directory `/export/home/joseph/egbugs'
eph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/cpp -lang-c++ -v -undef
-D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix
-D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS
-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) b30.cc /var/tmp/cc8g20WG
GNU CPP version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /home/joseph/egcs/include/g++
 /usr/local/include
 /home/joseph/egcs/sparc-sun-solaris2.5/include
 /home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/include
 /usr/include
End of search list.
 /home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/cc1plus
/var/tmp/cc8g20WG -quiet -dumpbase b30.cc -version -o /var/tmp/cciSIJ3i
GNU C++ version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental)
(sparc-sun-solaris2.5) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2
release).
b30.cc: In function `void f()':
b30.cc:12: invalid operands `const Y &' and `int' to binary `operator +'
gmake[1]: *** [b30] Error 1


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