This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64931] New: ICE on function with deduced return type and input is instantiated template class
- From: "sneves at dei dot uc.pt" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Feb 2015 02:10:49 +0000
- Subject: [Bug c++/64931] New: ICE on function with deduced return type and input is instantiated template class
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64931
Bug ID: 64931
Summary: ICE on function with deduced return type and input is
instantiated template class
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sneves at dei dot uc.pt
Minimal example:
template<typename T, unsigned long N>
struct array {
T data[N];
};
auto copy(array<int, 32> const& x) {
return x;
}
This only seems to result in ICE if a) `copy` has deduced return type with
value semantics, i.e. `auto` but not `decltype(auto)`, and b) if the `array`
struct is a template, and `copy` takes in a specific instantiation of `array`.
Verified to ICE in GCC 4.8.2, 4.9.2, and 5.0.0 20150202.