http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58481
Bug ID: 58481
Summary: Internal compiler error when passing argument packs to
base class method inside a lambda
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rush at rushbase dot net
Created attachment 30869
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30869&action=edit
Preprocessed file
# g++ -v
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--program-suffix=-4.8 --enable-linux-futex --without-system-libunwind
--with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux)
Compiling with:
# g++ test.cpp -std=c++11
The test being:
#include <functional>
struct Test {
template<typename... Args> inline void triggerTest (Args&&... fargs) { }
};
struct TestPickled : Test {
template<typename... Args> void triggerTest (Args&&... fargs) {
std::bind([=](Args... as) { // same problem when passing argument pack to
lambda instead of std::bind
Test::triggerTest(as...);
// this->_Test::triggerTest(as...);
// ^^^^^^^ THIS WORKAROUNDS THE PROBLEM
}, fargs...);
}
};
int main()
{
TestPickled test;
test.triggerTest();
return 0;
}
Error output:
g++bug.c++: In instantiation of ‘_TestPickled::triggerTest(Args&& ...) [with
Args = {}]::__lambda0’:
g++bug.c++:15:16: required from ‘struct _TestPickled::triggerTest(Args&& ...)
[with Args = {}]::__lambda0’
g++bug.c++:20:15: required from ‘void _TestPickled::triggerTest(Args&& ...)
[with Args = {}]’
g++bug.c++:27:19: required from here
g++bug.c++:17:28: internal compiler error: in build_base_path, at
cp/class.c:278
_Test::triggerTest(as...);