This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38950] New: ICE: deducing function template arguments for array type.
- From: "schaub-johannes at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2009 21:38:18 -0000
- Subject: [Bug c++/38950] New: ICE: deducing function template arguments for array type.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following snippet makes GCC 4.3.2 (and SVN versions as of 09/2008 still)
cause an ICE:
template <typename T, T N> void f(T(&)[N]);
int main() {
int x[2];
unsigned int y[2];
f(x); // works
f(y); // ICE
}
Getting this output:
test.cpp: In function 'int main()':
test.cpp:7: internal compiler error: in dependent_type_p, at cp/pt.c:15585
More information about this issue:
http://stackoverflow.com/questions/472530/how-to-pass-an-array-size-as-a-template-with-template-type
--
Summary: ICE: deducing function template arguments for array
type.
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schaub-johannes at web dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38950