From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5457 invoked by alias); 17 Nov 2011 09:13:06 -0000 Received: (qmail 5447 invoked by uid 22791); 17 Nov 2011 09:13:05 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Nov 2011 09:12:52 +0000 From: "mario-baumann at web dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51188] New: invalid static_cast from type 'XBase' to type 'int' Date: Thu, 17 Nov 2011 09:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mario-baumann at web dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg01730.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: mario-baumann@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 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