This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52744] New: bad handling of member (function) pointers in template parameters
- From: "blaffablaffa at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Mar 2012 19:36:47 +0000
- Subject: [Bug c++/52744] New: bad handling of member (function) pointers in template parameters
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52744
Bug #: 52744
Summary: bad handling of member (function) pointers in template
parameters
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: blaffablaffa@gmail.com
Created attachment 27017
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27017
the two test cases
The bug is well described in this stackoverflow question:
http://stackoverflow.com/questions/9893521/ambiguity-partial-template-specialization-for-member-and-member-functions#comment12624275_9893521
Description:
it seems that g++ 4.6.1 (probably both 4.6.* 4.7.*) has trouble in handling
template parameters of the kind of member pointers or member function pointers
in class partial specialization.
ambiguous.cpp fails with error is triggered at line 54 and 55 ("ambiguous class
template instantiation").
crash.cpp is an attempt to workaround with std::enable_if in typedefs within
the class bodies. But unfortunately that triggers a worse error, a crash of the
compiler, when trying to instantiate the partial specialization for pointers to
member object.
See source for ulterior comments.
My g++ version:
Using built-in specs.
COLLECT_GCC=/usr/bin/g++-4.6.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
Both the attachments work with g++ 4.5.1 (from ideone.com). Other guys from
stackoverflow tried to compile ambiguous.cpp (see the comments), and it works
with clang 3.1 and g++ 4.5.3, but not with g++ 4.6.2 and 4.7.something (sic).