<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 --- - std::swap() doesn't work with multi-dimensional ranges"
   href="http://llvm.org/bugs/show_bug.cgi?id=22106">22106</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::swap() doesn't work with multi-dimensional ranges
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>pgriess@gmail.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>$ cat foo.cpp
#include <utility>

int main(int argc, char** argv) {
    int src[8][8];
    decltype(src) dest;

    std::swap(src, dest);

    return 0;
}

$ clang++ -stdlib=libc++ -std=c++11 foo.cpp
In file included from foo.cpp:1:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:211:9:
error: call to function 'swap' that is neither visible in
      the template definition nor found by argument-dependent lookup
        swap(*__first1, *__first2);
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:220:12:
note: in instantiation of function template
      specialization 'std::__1::swap_ranges<int (*)[8], int (*)[8]>' requested
here
    _VSTD::swap_ranges(__a, __a + _Np, __b);
           ^
foo.cpp:7:10: note: in instantiation of function template specialization
'std::__1::swap<int [8], 8>' requested here
    std::swap(src, dest);
         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:218:1:
note: 'swap' should be declared prior to the call site
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
^
1 error generated.

$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

Changing src to a 'int[8]' from 'int[8][8]' does not trigger the issue.</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>