https://bugs.llvm.org/show_bug.cgi?id=47248
Bug ID: 47248
Summary: auto type of variables can not compile
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
The following code is valid in GCC, Clang rejects it:
$ cat s.C
#include <iostream>
auto add(auto a, auto b) { return a + b;}
int main()
{
std::cout
<< add(3.5, 4) << "\n"
<< add(3, 4.5) << "\n";
}
$ clang++ -c s.C
s.C:3:10: error: 'auto' not allowed in function prototype
auto add(auto a, auto b) { return a + b;}
^~~~
s.C:3:18: error: 'auto' not allowed in function prototype
auto add(auto a, auto b) { return a + b;}
^~~~
2 errors generated.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs