https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89011

            Bug ID: 89011
           Summary: member function pointer template argument with
                    initialization by constant generates ICE
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ahangauer at gmx dot net
  Target Milestone: ---

The following code 

template <class X, bool (X::*fcn)(int param)=0 >
struct test   {
        int v;
};

struct dummy {
        bool fcn(int);
};
using TT = test<dummy, &dummy::fcn>;    // works
using TT = test<dummy, 0>;                              // generates ICE
using TT = test<dummy>;                                 // generates ICE


generates an ICE on my gcc:

test_bug.cpp:12:25: internal compiler error: in instantiate_type, at
cp/class.c:8504
 using TT = test<dummy, 0>;
                         ^
libbacktrace could not find executable to open
Please submit a full bug report.

This is the gcc -v output 

Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-7.3.0/configure --prefix=/mingw64
--with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
--libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch
--disable-libstdcxx-debug --disable-isl-version-check --enable-lto
--enable-libgomp --disable-multilib --enable-checking=release --disable-rpath
--disable-win32-registry --disable-nls --disable-werror --disable-symvers
--with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64
--with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2
project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld
Thread model: posix
gcc version 7.3.0 (Rev2, Built by MSYS2 project)

Reply via email to