<div class="gmail_quote">On Sun, Apr 29, 2012 at 11:59 AM, Nathan Ridge <span dir="ltr"><<a href="mailto:zeratul976@hotmail.com">zeratul976@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hello,<br>
<br>
The following code fails to compile with Clang trunk:<br>
<br>
template <class T, class U><br>
struct pair<br>
{<br>
    T first;                <br>
    U second;                <br>
<br>
    pair() : first(), second() {}<br>
<br>
    pair(const pair&) = default;<br>
};<br>
<br>
struct S<br>
{<br>
    S() {}<br>
    S(const S&) = delete;<br>
    S(S&&) = default;<br>
};<br>
<br>
int main()<br>
{<br>
    pair<int, S> p;<br>
}<br>
<br>
The errors are:<br>
<br>
test.cpp:9:5: error: the parameter for this explicitly-defaulted copy constructor is const, but a member or base requires it to be<br>
      non-const<br>
    pair(const pair&) = default;<br>
    ^<br>
test.cpp:21:18: note: in instantiation of template class 'pair<int, S>' requested here<br>
    pair<int, S> p;<br>
                 ^<br></blockquote><div><br></div><div>Thanks for the report! This issue was fixed over a week ago. Trunk clang accepts your code.</div></div>