[LLVMbugs] [Bug 20218] New: clang-cl cannot correctly compile std::pair's which have a function pointer as one of their types

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 5 18:43:20 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20218

            Bug ID: 20218
           Summary: clang-cl cannot correctly compile std::pair's which
                    have a function pointer as one of their types
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ 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
<https://github.com/mozilla/angle/blob/mozilla/src/libGLESv2/renderer/d3d9/formatutils9.cpp#L297>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140706/9da72d27/attachment.html>


More information about the llvm-bugs mailing list