[LLVMbugs] [Bug 22106] New: std::swap() doesn't work with multi-dimensional ranges
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jan 6 09:39:42 PST 2015
http://llvm.org/bugs/show_bug.cgi?id=22106
Bug ID: 22106
Summary: std::swap() doesn't work with multi-dimensional ranges
Product: libc++
Version: 3.4
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: pgriess at gmail.com
CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
Classification: Unclassified
$ 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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150106/3dec5164/attachment.html>
More information about the llvm-bugs
mailing list