The attached test case should produce no output when executed.  However, when
compiled with the following command-line arguments...

g++ pure_virtual_function_test.cpp -fno-strict-aliasing -O -o fail_test

the test case produces the following output...

pure virtual method called
terminate called without an active exception
Aborted

The assembly code for MakeNvSsInportsNvIfNeeded shows that the call to
DescSysOutportSourceHandler::handleEachDescSys is passed the vtable for
DescSysOutportSourceHandler.  However the call to
DescSysSelfLoopHandler::handleEachDescSys is passed the vtable for
DescSysIteratorNc instead of the vtable for DescSysSelfLoopHandler.

The output of "g++ -v" follows...
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../../../sources/gcc-4.3/configure
--prefix=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4
--with-gmp=/sandbox/rjarrett/3p-gcc/3p/derived/glnxa64/gcc-4.3/gmp
--with-mpfr=/sandbox/rjarrett/3p-gcc/3p/derived/glnxa64/gcc-4.3/mpfr
--enable-languages=c,c++,fortran
--with-as=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4/bin/as
--with-ld=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4/bin/ld
--disable-multilib
Thread model: posix
gcc version 4.3.4 (GCC)


-- 
           Summary: pure virtual method called when compiling with "-fno-
                    strict-aliasing -O"
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Troy dot Runkel at mathworks dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42394

Reply via email to