https://llvm.org/bugs/show_bug.cgi?id=26656
Bug ID: 26656 Summary: std::swap does not work with vector types Product: libc++ Version: 3.8 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: eugeni.stepa...@gmail.com CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified #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. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs