https://bugs.llvm.org/show_bug.cgi?id=49659
Bug ID: 49659
Summary: incomplete type with gcc and libc++ when overloading
std::swap
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: yichen....@inf.ethz.ch
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
Created attachment 24662
--> https://bugs.llvm.org/attachment.cgi?id=24662&action=edit
test.clang.merged.proc.cc
I'm following the instructions on https://libcxx.llvm.org/docs/UsingLibcxx.html
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++}.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs