Bug 54927 - internal compiler error: in tsubst_copy, at cp/pt.c:12349
Summary: internal compiler error: in tsubst_copy, at cp/pt.c:12349
Status: RESOLVED DUPLICATE of bug 54844
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 54929 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-14 22:36 UTC by Craig Schroeder
Modified: 2012-10-15 07:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Schroeder 2012-10-14 22:36:08 UTC
When compiling this program without options:

template<class T> class A {void F(){sizeof(double);}};
template class A<int>;


The compilation should succeed, but I get the following output:


prog.cpp: In instantiation of ‘void A<T>::F() [with T = int]’:
prog.cpp:2:16:   required from here
prog.cpp:1:43: internal compiler error: in tsubst_copy, at cp/pt.c:12349
 template<class T> class A {void F(){sizeof(double);}};
                                           ^
0x5835ca tsubst_copy
	../../s-4.8/gcc/cp/pt.c:12349
0x57364e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	../../s-4.8/gcc/cp/pt.c:13476
0x573543 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
	../../s-4.8/gcc/cp/pt.c:13501
0x57aeba tsubst_expr
	../../s-4.8/gcc/cp/pt.c:13156
0x57c8c8 tsubst_expr
	../../s-4.8/gcc/cp/pt.c:12641
0x57c465 tsubst_expr
	../../s-4.8/gcc/cp/pt.c:12811
0x579d86 instantiate_decl(tree_node*, int, bool)
	../../s-4.8/gcc/cp/pt.c:18633
0x5b43a3 instantiate_pending_templates(int)
	../../s-4.8/gcc/cp/pt.c:18732
0x5efc00 cp_write_global_declarations()
	../../s-4.8/gcc/cp/decl2.c:3993
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


Output of g++ -v:

Using built-in specs.
COLLECT_GCC=/new-gcc/i-4.8/bin/g++
COLLECT_LTO_WRAPPER=/new-gcc/i-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-4.8/configure --prefix=/new-gcc/i-4.8
Thread model: posix
gcc version 4.8.0 20121014 (experimental) (GCC)
Comment 1 Paolo Carlini 2012-10-14 22:50:10 UTC
A nice short duplicate of PR54844.

*** This bug has been marked as a duplicate of bug 54844 ***
Comment 2 Paolo Carlini 2012-10-15 07:52:11 UTC
*** Bug 54929 has been marked as a duplicate of this bug. ***