This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50853] New: Internal Compiler Error returning a template type using brace initialization
- From: "public at alisdairm dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Oct 2011 13:06:11 +0000
- Subject: [Bug c++/50853] New: Internal Compiler Error returning a template type using brace initialization
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50853
Bug #: 50853
Summary: Internal Compiler Error returning a template type
using brace initialization
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: public@alisdairm.net
The following obscure code produces an ICE when the function template 'test' is
called:
template<int> struct MyType{};
template<int VAL>
auto test(MyType<VAL>) -> MyType<int{VAL}> { return {}; }
int main() {
MyType<int{256}>{};
test( MyType<256>{} ); // no error without this call
}
The ICE produced is:
internal compiler error: in tsubst_copy_and_build, at cp/pt.c:13389