<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - incomplete type with gcc and libc++ when overloading std::swap"
   href="https://bugs.llvm.org/show_bug.cgi?id=49659">49659</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>incomplete type with gcc and libc++ when overloading std::swap
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>yichen.yan@inf.ethz.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24662" name="attach_24662" title="test.clang.merged.proc.cc">attachment 24662</a> <a href="attachment.cgi?id=24662&action=edit" title="test.clang.merged.proc.cc">[details]</a></span>
test.clang.merged.proc.cc

I'm following the instructions on <a href="https://libcxx.llvm.org/docs/UsingLibcxx.html">https://libcxx.llvm.org/docs/UsingLibcxx.html</a>
to use libc++ with gcc,
and have met this failure:

root@24a281e738f9:/test/clang# /usr/bin/c++ -nostdinc++
-I/libcxx-install-11/include/c++/v1 -o /dev/null -c test.clang.merged.proc.cc
test.clang.merged.proc.cc: In instantiation of 'Pointer<T>::Pointer(const
Pointer<T>&) [with T = d]':
/libcxx-install-11/include/c++/v1/type_traits:4075:9:   required from 'typename
std::__1::enable_if<(std::__1::is_move_constructible<_Tp>::value &&
std::__1::is_move_assignable<_Tp>::value)>::type std::__1::swap(_Tp&, _Tp&)
[with _Tp = Pointer<d>; typename
std::__1::enable_if<(std::__1::is_move_constructible<_Tp>::value &&
std::__1::is_move_assignable<_Tp>::value)>::type = void]'
test.clang.merged.proc.cc:39:46:   required from here
test.clang.merged.proc.cc:23:33: error: invalid use of incomplete type 'class
d'
   Pointer(const Pointer &) { b->c; }
                              ~~~^
test.clang.merged.proc.cc:30:7: note: forward declaration of 'class d'
 class d;
       ^

Notably, this works with clang and {libstdc++,libc++}.</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>