<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang-cl cannot correctly compile std::pair's which have a function pointer as one of their types"
href="http://llvm.org/bugs/show_bug.cgi?id=20218">20218</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-cl cannot correctly compile std::pair's which have a function pointer as one of their types
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ehsan@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat test.cpp
template<class T, class U> struct pair {
pair(const T&, const U&);
template<class X, class Y>
pair(X&&, Y&&);
};
template<class>void f();
typedef pair<int,void(*)()> t;
void g() {
t x(0,f<int>);
}
$ clang-cl -c test.cpp
test.cpp(9,5) : error: call to constructor of 't' (aka 'pair<int, void
(*)()>') is ambiguous
t x(0,f<int>);
^ ~~~~~~~~
test.cpp(2,3) : note: candidate constructor
pair(const T&, const U&);
^
test.cpp(4,3) : note: candidate constructor [with X = int, Y = void ()]
pair(X&&, Y&&);
^
1 error generated.
Unfortunately this bug is reduced from std::pair in the Microsoft <utility>
header for Visual C++ 2012. I hit this bug in the latest version of angle
<<a href="https://github.com/mozilla/angle/blob/mozilla/src/libGLESv2/renderer/d3d9/formatutils9.cpp#L297">https://github.com/mozilla/angle/blob/mozilla/src/libGLESv2/renderer/d3d9/formatutils9.cpp#L297</a>></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>