[Bug c++/69743] New: function overload - template instantiation depth exceeds maximum (gcc4, clang - no problem)
Konstantin.Sadov at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Feb 10 11:07:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69743
Bug ID: 69743
Summary: function overload - template instantiation depth
exceeds maximum (gcc4, clang - no problem)
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Konstantin.Sadov at gmail dot com
Target Milestone: ---
The following code
[code]
template <typename D, typename... T>
void f(int, T... d)
{
}
template <typename D, typename... T>
void f(T... d)
{
f<D>(1, d...);
}
void g(void)
{
f<long>(1.0);
}
[code]
produces error
[error]
In instantiation of ‘void f(T ...) [with D = long int; T = {int, lots of int,
int, double}]’:
recursively required from ‘void f(T ...) [with D = long int; T = {int,
double}]’
required from ‘void f(T ...) [with D = long int; T = {double}]’
required from here
fatal error: template instantiation depth exceeds maximum of 900 (use
-ftemplate-depth= to increase the maximum)
[error]
gcc 4.4, gcc 4.7, clang 3.7 compiles the code without problems.
More information about the Gcc-bugs
mailing list