Bug 56462 - Simple use of auto in template function causes internal error in type_unification_real
Summary: Simple use of auto in template function causes internal error in type_unifica...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2013-02-26 16:05 UTC by Spraff
Modified: 2013-02-27 09:52 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.7.2, 4.8.0
Known to fail: 4.6.3
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Spraff 2013-02-26 16:05:17 UTC
Here is a complete source file which causes the error

*********************************************
template <typename F>
void foo (F & f)
{
        auto f_copy = *f;
}
*********************************************

Compiling this on ubuntu 12.04 with

    g++ test.cpp -std=c++0x

yields the following error

    test.cpp: In function ‘void foo(F&)’:
    test.cpp:4:17: internal compiler error: in type_unification_real, at cp/pt.c:13573
Comment 1 Jonathan Wakely 2013-02-26 16:27:51 UTC
G++ 4.5 is no longer supported or maintained, for experimental C++11 features you should really try a current release. This works fine with 4.7 or trunk.
Comment 2 Paolo Carlini 2013-02-27 09:52:35 UTC
I guess we can safely close it then.