http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51188
Bug #: 51188 Summary: invalid static_cast from type 'XBase' to type 'int' Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: mario-baum...@web.de Created attachment 25844 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25844 c++ source Hi all, i found a strange "bug" while compiling the attached c++ file > g++ -c x.cpp x.cpp: In member function 'std::pair<int, int> X::getImp() const': x.cpp:15:57: error: invalid static_cast from type 'XBase' to type 'int' if I remove any of the superfluous statements in x.cpp it works fine! mario. ------------------------------------------------------------------------------ > uname -a Linux ahsoka.intec.dom 2.6.32-131.17.1.el6.x86_64 #1 SMP Thu Sep 29 10:24:25 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux > rpm -qa "glibc*" | grep -e 'glibc-[0-9]' | sort -u glibc-2.12-1.25.el6_1.3.i686 glibc-2.12-1.25.el6_1.3.x86_64 > g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/app2/gcc/4.7.0-20111117-svn181436/x86_64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/app2/gcc/4.7.0-20111117-svn181436/x86_64 --enable-languages=c,c++,fortran --disable-nls --with-gmp=/app2/gcc/4.7.0-20111117-svn181436/x86_64/aux --with-mpfr=/app2/gcc/4.7.0-20111117-svn181436/x86_64/aux --with-mpc=/app2/gcc/4.7.0-20111117-svn181436/x86_64/aux --with-ppl=/app2/gcc/4.7.0-20111117-svn181436/x86_64/aux --with-cloog=/app2/gcc/4.7.0-20111117-svn181436/x86_64/aux Thread model: posix gcc version 4.7.0 20111117 (experimental) (GCC) > ld -v GNU ld (GNU Binutils) 2.22.51.20111117