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



             Bug #: 56836

           Summary: Template delegating constructor not calling target

                    constructor

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: rob.desb...@gmail.com





Created attachment 29799

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29799

Preprocessed source to reproduce failure



Source attached with template delegating constructor; no call to the desired

target is performed.



[rob@robdes tests]$ g++ -v -save-temps --std=c++11

bug-constructor-delegation.cpp

Using built-in specs.

COLLECT_GCC=g++

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper

Target: x86_64-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man

--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla

--enable-bootstrap --enable-shared --enable-threads=posix

--enable-checking=release --disable-build-with-cxx

--disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit

--disable-libunwind-exceptions --enable-gnu-unique-object

--enable-linker-build-id --with-linker-hash-style=gnu

--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin

--enable-initfini-array --enable-java-awt=gtk --disable-dssi

--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre

--enable-libgcj-multifile --enable-java-maintainer-mode

--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib

--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686

--build=x86_64-redhat-linux

Thread model: posix

gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC) 

COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'

'-mtune=generic' '-march=x86-64'

 /usr/libexec/gcc/x86_64-redhat-linux/4.7.2/cc1plus -E -quiet -v -D_GNU_SOURCE

bug-constructor-delegation.cpp -mtune=generic -march=x86-64 -std=c++11

-fpch-preprocess -o bug-constructor-delegation.ii

ignoring nonexistent directory

"/usr/lib/gcc/x86_64-redhat-linux/4.7.2/include-fixed"

ignoring nonexistent directory

"/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../x86_64-redhat-linux/include"

#include "..." search starts here:

#include <...> search starts here:

 /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2



/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/x86_64-redhat-linux

 /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/backward

 /usr/lib/gcc/x86_64-redhat-linux/4.7.2/include

 /usr/local/include

 /usr/include

End of search list.

COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'

'-mtune=generic' '-march=x86-64'

 /usr/libexec/gcc/x86_64-redhat-linux/4.7.2/cc1plus -fpreprocessed

bug-constructor-delegation.ii -quiet -dumpbase bug-constructor-delegation.cpp

-mtune=generic -march=x86-64 -auxbase bug-constructor-delegation -std=c++11

-version -o bug-constructor-delegation.s

GNU C++ (GCC) version 4.7.2 20120921 (Red Hat 4.7.2-2) (x86_64-redhat-linux)

        compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2), GMP version

5.0.2, MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

GNU C++ (GCC) version 4.7.2 20120921 (Red Hat 4.7.2-2) (x86_64-redhat-linux)

        compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2), GMP version

5.0.2, MPFR version 3.1.0, MPC version 0.9

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Compiler executable checksum: c80d6366117d4cf1da5e1787031f4a46

COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'

'-mtune=generic' '-march=x86-64'

 as -v --64 -o bug-constructor-delegation.o bug-constructor-delegation.s

GNU assembler version 2.22.52.0.1 (x86_64-redhat-linux) using BFD version

version 2.22.52.0.1-10.fc17 20120131

COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/:/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.7.2/:/usr/lib/gcc/x86_64-redhat-linux/

LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.7.2/:/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-shared-libgcc'

'-mtune=generic' '-march=x86-64'

 /usr/libexec/gcc/x86_64-redhat-linux/4.7.2/collect2 --build-id --no-add-needed

--eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker

/lib64/ld-linux-x86-64.so.2

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crti.o

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtbegin.o

-L/usr/lib/gcc/x86_64-redhat-linux/4.7.2

-L/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64 -L/lib/../lib64

-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../..

bug-constructor-delegation.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtend.o

/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crtn.o





Output of run:

[rob@robdes tests]$ ./a.out

a.out: bug-constructor-delegation.cpp:25: int main(): Assertion `f2.i == 1'

failed.

Aborted (core dumped)

Reply via email to