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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to