<html>
    <head>
      <base href="https://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 --- - std::swap does not work with vector types"
   href="https://llvm.org/bugs/show_bug.cgi?id=26656">26656</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::swap does not work with vector types
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.8
          </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>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>eugeni.stepanov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>#include <utility>

typedef float T  __attribute__((__vector_size__(16)));

void f(T &a, T &b) {
  std::swap(a, b);
}


1.cc:7:3: error: no matching function for call to 'swap'
  std::swap(a, b);
  ^~~~~~~~~
/code/build-llvm/bin/../include/c++/v1/type_traits:4240:5: note: candidate
template ignored: disabled by 'enable_if' [with _Tp =
      __attribute__((__vector_size__(4 * sizeof(float)))) float]
    is_move_constructible<_Tp>::value &&
    ^
/code/build-llvm/bin/../include/c++/v1/utility:245:1: note: candidate template
ignored: could not match '_Tp [_Np]' against 'T'
      (vector of 4 'float' values)
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
^
/code/build-llvm/bin/../include/c++/v1/utility:495:1: note: candidate template
ignored: could not match
      'pair<type-parameter-0-0, type-parameter-0-1>' against
'__attribute__((__vector_size__(4 * sizeof(float)))) float'
      (vector of 4 'float' values)
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
^
1 error generated.</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>