<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 --- - Unqualified calls of std::get lead to ADL issues"
   href="http://llvm.org/bugs/show_bug.cgi?id=20092">20092</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unqualified calls of std::get lead to ADL issues
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kaballo86@hotmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12689" name="attach_12689" title="proposed fix">attachment 12689</a> <a href="attachment.cgi?id=12689&action=edit" title="proposed fix">[details]</a></span>
proposed fix

Several calls to `std::get<I>` are unqualified within the implementation, which
leads to ADL related issues such as resolving to user-defined overloads:

    #include <tuple>
    #include <utility>

    namespace foo {
      struct bar { bool operator==(bar) const { return true; } };

      template <std::size_t I>
      void get(std::tuple<foo::bar, int>) {}
    }

    int main()
    {
      std::tuple<foo::bar, int> t1, t2;
      t1 == t2; // error: invalid operands to binary expression ('void' and
'void')
    }

or perhaps less contrivedly triggering hard errors during overload resolution:

    #include <tuple>
    #include <utility>

    namespace foo {
      struct bar { bool operator==(bar) const { return true; } };

      template <std::size_t I>
      struct hard_error { static_assert(I > 0, ""); using type = void; };

      template <std::size_t I, typename T>
      typename hard_error<I>::type get(T) {}
    }

    int main()
    {
      std::tuple<foo::bar, int> t1, t2;
      t1 == t2; // error: static_assert failed ""
                // note: in instantiation of template class
'foo::hard_error<0>'
                // note: while substituting explicitly-specified template
arguments into function template 'get' 
    }</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>