http://llvm.org/bugs/show_bug.cgi?id=19639
Bug ID: 19639
Summary: Overloaded function template instantiation with
decltype recurses infinitely
Product: clang
Version: 3.4
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
---- testcase ----
struct Number { };
template<typename T1, typename T2>
static int foo(T1&, T2&) { return 1; }
template<typename T1>
static auto foo(T1 &a, int) -> decltype(foo(a, *new Number())) { return foo(a,
*new Number()); }
int main() { return foo(*new Number(), 8); }
---- error ----
testcase.cpp:4:12: fatal error: recursive template instantiation exceeded
maximum depth of 256
static int foo(T1&, T2&) { return 1; }
^
testcase.cpp:7:13: note: while substituting deduced template arguments into
function template 'foo' [with T1 = Number]
The code works in g++ 4.8. It also works when declaring an explicit return
type.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs