Launchpad has imported 8 comments from the remote bug at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51833.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2012-01-12T05:30:31+00:00 Richard Eames wrote:

$ g++ -std=c++0x -o test.bin testcase.cpp
test.cpp: In member function ‘void Foo::dostuff(T, U) [with T = Bar, U = 
bool(Arg*)]’:
test.cpp:21:17: internal compiler error: in tsubst_copy, at cp/pt.c:11333
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.



$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
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)

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/0

------------------------------------------------------------------------
On 2012-01-12T05:31:05+00:00 Richard Eames wrote:

Created attachment 26304
Testcase

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/1

------------------------------------------------------------------------
On 2012-01-12T05:58:23+00:00 Richard Eames wrote:

Tested in 4.7.0, fails too.


$ /usr/lib/gcc-snapshot/bin/g++ -std=c++0x -o test.bin testcase.cpp
testcase.cpp: In member function 'void Foo::dostuff(T, U) [with T = Bar; U = 
bool(Arg*)]':
testcase.cpp:21:17: internal compiler error: in tsubst_copy, at cp/pt.c:11748


$ /usr/lib/gcc-snapshot/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 
20111010-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs 
--enable-languages=c,ada,c++,java,fortran,objc,obj-c++,go 
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id 
--with-system-zlib --disable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin 
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.7-snap/jre --enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.7-snap 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.7-snap 
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar 
--enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic 
--enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu 
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.0 20111010 (experimental) [trunk revision 179769] 
(Ubuntu/Linaro 20111010-0ubuntu1)

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/2

------------------------------------------------------------------------
On 2012-01-12T08:52:43+00:00 Rguenth wrote:

Confirmed.  Not sure if the testcase is valid or not.

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/3

------------------------------------------------------------------------
On 2012-01-12T09:34:49+00:00 Redi wrote:

It's not valid, you can't pass a function type by value

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/4

------------------------------------------------------------------------
On 2012-01-12T20:01:15+00:00 Richard Eames wrote:

I've reduced the testcase further. It appears to be a problem with
templates. The reason I was passing a function type in the template was
because std::function<bool(Arg*)> wouldn't work for me. If I take out
the first parameter so that it's just the function pointer, then
std::function works with the lambda as a default argument, but as soon
as the function is templated I get the IRC.

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/5

------------------------------------------------------------------------
On 2012-01-12T20:01:52+00:00 Richard Eames wrote:

Created attachment 26309
Reduced test case

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/6

------------------------------------------------------------------------
On 2012-01-12T20:43:04+00:00 Redi wrote:

Further reduced

struct function
{
  template<typename T>
    function(T) { }
};

class Foo {
public:
  template<typename>
    void dostuff(function callback = []() { }) { }
};

int main() {
  Foo foo;
  foo.dostuff<int>();
}

Reply at: https://bugs.launchpad.net/gcc/+bug/1036320/comments/7


** Changed in: gcc
       Status: Unknown => Confirmed

** Changed in: gcc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1036320

Title:
  internal compiler error: in tsubst_copy

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1036320/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to