This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Put clang::trivial_abi on std::unique_ptr
ClosedPublic

Authored by oontvoo on Jun 24 2020, 12:09 PM.

Diff Detail

Event Timeline

oontvoo created this revision.Jun 24 2020, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2020, 12:09 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jgorbe added a subscriber: jgorbe.Jun 24 2020, 12:18 PM
rsmith added a subscriber: rsmith.Jun 24 2020, 12:50 PM

See also https://reviews.llvm.org/D63748; I'm happy to abandon that in favor of your work here.

This will need test cases. I think we should also consider whether we want to apply this to shared_ptr too, as D63748, and if so, whether we want a single configuration macro to apply [[trivial_abi]] to both classes, or one macro for each.

libcxx/docs/DesignDocs/UniquePtrTrivialAbi.rst
40

Typo "attribuate".

45–47

This change to destroy unique_ptr parameters in the callee is technically non-conforming, because it changes destruction order for function parameters to an order that is observably different from any order that a correct implementation can produce. For example:

struct A { ~A(); };
struct B { ~B(); };
struct C { C(A, unique_ptr<B>, A) {} };
C c{{}, make_unique<B>, {}};

In a conforming implementation, the destruction order for C::C's parameters is required to be ~A(), ~B(), ~A(), but with this mode enabled, we'll instead see ~B(), ~A(), ~A(). That's probably fine in practice for almost all users (and this isn't the only case in which implementations get destruction order for function parameters "wrong"), but it seems worth pointing out here. This isn't just a different behavior, it's a behavior disallowed by the standard.

97

Typo "headrer"

oontvoo marked 2 inline comments as done.Jun 24 2020, 1:14 PM

This will need test cases. I think we should also consider whether we want to apply this to shared_ptr too, as D63748,

Do you have any concern on *not* doing this for shared_ptr?

and if so, whether we want a single configuration macro to apply [[trivial_abi]] to both classes, or one macro for each.

One reason that I'd prefer having 2 separate nobs *for now* is because it'd makes it easier to land this into the internal repo :) (We've done a few passes at cleaning up broken things for unique_ptr, but nothing for shared_ptr yet.)

oontvoo updated this revision to Diff 273143.Jun 24 2020, 1:15 PM

fixed typo

oontvoo updated this revision to Diff 273191.Jun 24 2020, 4:55 PM
oontvoo marked an inline comment as done.

added note on non-conforming destruction order as suggested

ldionne requested changes to this revision.Jun 25 2020, 1:09 PM
ldionne marked 2 inline comments as done.
ldionne added a subscriber: ldionne.

Thanks a lot for the great document explaining the change.

I agree with @rsmith that we should add a few tests for this change. They should go in libcxx/test/libcxx because they are libc++ specific, not mandated by the Standard.

Can you also handle shared_ptr and weak_ptr in this patch? You can add different knobs for unique_ptr and shared_ptr/weak_ptr if that makes your life easier, but that would allow considering this patch as a strict superset of https://reviews.llvm.org/D63748.

libcxx/docs/DesignDocs/UniquePtrTrivialAbi.rst
106

I think that's fine, since the Standard doesn't say whether unique_ptr should be destroyed in the callee or in the caller. All it says is that when a unique_ptr<T, std::default_delete<T>> is destroyed, T needs to be complete type.

128

I'll argue this is incredibly tricky -- you're using a pointer managed by a moved-from unique_ptr. I think it's reasonable to break this, actually it would be fine if it never worked in the first place.

133

Are you missing backticks around returned?

ldionne added inline comments.Jun 25 2020, 1:09 PM
libcxx/docs/DesignDocs/UniquePtrTrivialAbi.rst
146

Nit: Multiple spaces between not and yield.

libcxx/include/__config
109

I would prefer if that #define was just a straight macro definition without any expansion. That would be more consistent with how we deal with other ABI macros.

What you could then do is say in unique_ptr:

template <class _Tp, class _Dp = default_delete<_Tp> >
class 
#if defined(_LIBCPP_ABI_UNIQUE_PTR_TRIVIAL)
    __attribute__((trivial_abi))
#endif
_LIBCPP_TEMPLATE_VIS unique_ptr {
...

Or something equivalent. But ideally, the knob for turning on that optimization should just be to #define a macro to nothing.

This revision now requires changes to proceed.Jun 25 2020, 1:09 PM
oontvoo updated this revision to Diff 273511.Jun 25 2020, 2:11 PM
oontvoo marked 3 inline comments as done.

updated diff

libcxx/docs/DesignDocs/UniquePtrTrivialAbi.rst
133

wrong quotes. (meant to be emphasis, not code)

libcxx/include/__config
109

I'd put this here because I thought we might need to add a check for availability of the attribute. probably easier to read than repeating the same logic in a few places

Re : knob on this, we can still just undef the *ENABLE* flag, yes? (Or re-write it to be bool)

But having no familiarity with how these macros are handled, I've no preference.
Happy to change it, unless someone wants to chime in

oontvoo updated this revision to Diff 273537.Jun 25 2020, 3:39 PM

Added a test.

ldionne requested changes to this revision.Jun 27 2020, 3:17 AM

Please add tests for shared_ptr and weak_ptr too. And for unique_ptr<T[]>.

libcxx/include/__config
109

OK, here's the form I want this to have:

#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
<existing stuff>
// Enable clang::trivial_abi on std::unique_ptr.
#  define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
// Enable clang::trivial_abi on std::shared_ptr and weak_ptr.
#  define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
...
#endif

Then, right above unique_ptr:

#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
#  define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
#else
#  define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI 
#endif

template <class _Tp, class _Dp = default_delete<_Tp> >
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr { ... };

And do the same for shared_ptr and unique_ptr with a single macro called _LIBCPP_SHARED_PTR_TRIVIAL_ABI.

Please conform to that.

This revision now requires changes to proceed.Jun 27 2020, 3:17 AM
oontvoo updated this revision to Diff 274196.Jun 29 2020, 12:21 PM
oontvoo marked 2 inline comments as done.

Re-defined the macros as requested and Added more tests

oontvoo marked an inline comment as done.Jun 29 2020, 12:21 PM
oontvoo updated this revision to Diff 274198.Jun 29 2020, 12:24 PM

removed unrelated changes

oontvoo updated this revision to Diff 274887.Jul 1 2020, 12:08 PM

Add test only arg destruction order.
(This is the only test that can shows a difference between the two modes in Microsoft ABI)

Thanks a lot for the added tests, this looks almost good to go.

libcxx/include/__config
108

We shouldn't have such an important ABI property be dependent on compiler versions like this. I think we should unconditionally use the attribute -- it's fine to assume that someone tweaking these ABI flags is on a recent Clang.

oontvoo updated this revision to Diff 275140.Jul 2 2020, 8:47 AM
oontvoo marked an inline comment as done.

Removed __has_cpp_attribute() condition

ldionne accepted this revision.Jul 3 2020, 10:04 AM

Thanks! Do you need someone to commit this for you? If so, please mention the Author Name <email> to use.

@rsmith I think we can close https://reviews.llvm.org/D63748.

This revision is now accepted and ready to land.Jul 3 2020, 10:04 AM
oontvoo closed this revision.Jul 3 2020, 2:25 PM

Do you need someone to commit this for you? If so, please mention the Author Name <email> to use.

All set. Thanks!

What compilers was this tested on? This seems to be failing on clang 10 (Fedora 32 x86-64). Can we revert this or commit a quick fix?

FAIL: libc++ :: libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp (59754 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_ret.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_ret.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_ret.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name unique_ptr_ret.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/unique_ptr_ret-077a98.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:38: error: '
type_visibility__' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:7: error: variable has incomplete type 'class atribute'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: forward declaration of 'std::1::atribute__'
/home/dave/s/lp/libcxx/include/memory:2320:42: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^
;

/home/dave/s/lp/libcxx/include/memory:2326:59: error: C++ requires a type specifier for all declarations
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2327:1: error: expected expression
public:
^
/home/dave/s/lp/libcxx/include/memory:2534:38: error: 'type_visibility' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2534:7: error: redefinition of 'trivial_abi'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: previous definition is here
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2534:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^
;

/home/dave/s/lp/libcxx/include/memory:2534:59: error: no template named 'unique_ptr'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:70: error: use of undeclared identifier '_Tp'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:74: error: expected expression
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:82: error: expected unqualified-id
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

 ^

/home/dave/s/lp/libcxx/include/memory:2772:1: error: redefinition of 'swap' as different kind of symbol
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}
^
/home/dave/s/lp/libcxx/include/memory:2234:6: note: previous definition is here
void swap(compressed_pair<_T1, _T2>& x, compressed_pair<_T1, _T2>& y)

^

/home/dave/s/lp/libcxx/include/memory:2772:17: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:22: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:28: error: use of undeclared identifier 'x'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

/home/dave/s/lp/libcxx/include/memory:2772:44: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:49: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:55: error: use of undeclared identifier 'y'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


FAIL: libc++ :: libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp (59755 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_array.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_array.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_array.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name unique_ptr_array.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/unique_ptr_array-6e8676.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:38: error: '
type_visibility__' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:7: error: variable has incomplete type 'class atribute'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: forward declaration of 'std::1::atribute__'
/home/dave/s/lp/libcxx/include/memory:2320:42: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^
;

/home/dave/s/lp/libcxx/include/memory:2326:59: error: C++ requires a type specifier for all declarations
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2327:1: error: expected expression
public:
^
/home/dave/s/lp/libcxx/include/memory:2534:38: error: 'type_visibility' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2534:7: error: redefinition of 'trivial_abi'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: previous definition is here
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2534:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^
;

/home/dave/s/lp/libcxx/include/memory:2534:59: error: no template named 'unique_ptr'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:70: error: use of undeclared identifier '_Tp'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:74: error: expected expression
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:82: error: expected unqualified-id
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

 ^

/home/dave/s/lp/libcxx/include/memory:2772:1: error: redefinition of 'swap' as different kind of symbol
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}
^
/home/dave/s/lp/libcxx/include/memory:2234:6: note: previous definition is here
void swap(compressed_pair<_T1, _T2>& x, compressed_pair<_T1, _T2>& y)

^

/home/dave/s/lp/libcxx/include/memory:2772:17: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:22: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:28: error: use of undeclared identifier 'x'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

/home/dave/s/lp/libcxx/include/memory:2772:44: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:49: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:55: error: use of undeclared identifier 'y'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


FAIL: libc++ :: libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp (59764 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_destruction_order.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_destruction_order.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_destruction_order.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name unique_ptr_destruction_order.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/unique_ptr_destruction_order-12e1b5.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp:17:
/home/dave/s/lp/libcxx/include/memory:2326:38: error: '
type_visibility__' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp:17:
/home/dave/s/lp/libcxx/include/memory:2326:7: error: variable has incomplete type 'class atribute'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: forward declaration of 'std::1::atribute__'
/home/dave/s/lp/libcxx/include/memory:2320:42: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^
;

/home/dave/s/lp/libcxx/include/memory:2326:59: error: C++ requires a type specifier for all declarations
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2327:1: error: expected expression
public:
^
/home/dave/s/lp/libcxx/include/memory:2534:38: error: 'type_visibility' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp:17:
/home/dave/s/lp/libcxx/include/memory:2534:7: error: redefinition of 'trivial_abi'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: previous definition is here
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2534:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^
;

/home/dave/s/lp/libcxx/include/memory:2534:59: error: no template named 'unique_ptr'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:70: error: use of undeclared identifier '_Tp'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:74: error: expected expression
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:82: error: expected unqualified-id
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

 ^

/home/dave/s/lp/libcxx/include/memory:2772:1: error: redefinition of 'swap' as different kind of symbol
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}
^
/home/dave/s/lp/libcxx/include/memory:2234:6: note: previous definition is here
void swap(compressed_pair<_T1, _T2>& x, compressed_pair<_T1, _T2>& y)

^

/home/dave/s/lp/libcxx/include/memory:2772:17: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:22: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:28: error: use of undeclared identifier 'x'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

/home/dave/s/lp/libcxx/include/memory:2772:44: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:49: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:55: error: use of undeclared identifier 'y'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


FAIL: libc++ :: libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp (59768 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/weak_ptr_ret.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/weak_ptr_ret.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/weak_ptr_ret.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name weak_ptr_ret.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/weak_ptr_ret-b44766.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
/home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp:40:39: error: use of undeclared identifier 'shared'

auto sptr = std::make_shared<Node>(&shared);
                                    ^

1 error generated.


FAIL: libc++ :: libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp (59769 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_arg.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_arg.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/unique_ptr_arg.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name unique_ptr_arg.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/unique_ptr_arg-2e4cf3.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:38: error: '
type_visibility__' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2326:7: error: variable has incomplete type 'class atribute'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: forward declaration of 'std::1::atribute__'
/home/dave/s/lp/libcxx/include/memory:2320:42: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^
;

/home/dave/s/lp/libcxx/include/memory:2326:59: error: C++ requires a type specifier for all declarations
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2327:1: error: expected expression
public:
^
/home/dave/s/lp/libcxx/include/memory:2534:38: error: 'type_visibility' attribute only applies to types and namespaces
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/__config:693:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'

define _LIBCPP_TEMPLATE_VIS attribute ((type_visibility("default")))

^

In file included from /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp:15:
/home/dave/s/lp/libcxx/include/memory:2534:7: error: redefinition of 'trivial_abi'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2326:7: note: previous definition is here
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {

^

/home/dave/s/lp/libcxx/include/memory:2320:56: note: expanded from macro '_LIBCPP_UNIQUE_PTR_TRIVIAL_ABI'

define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI atribute((trivial_abi))

^

/home/dave/s/lp/libcxx/include/memory:2534:58: error: expected ';' at end of declaration
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^
;

/home/dave/s/lp/libcxx/include/memory:2534:59: error: no template named 'unique_ptr'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:70: error: use of undeclared identifier '_Tp'
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:74: error: expected expression
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

^

/home/dave/s/lp/libcxx/include/memory:2534:82: error: expected unqualified-id
class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {

 ^

/home/dave/s/lp/libcxx/include/memory:2772:1: error: redefinition of 'swap' as different kind of symbol
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}
^
/home/dave/s/lp/libcxx/include/memory:2234:6: note: previous definition is here
void swap(compressed_pair<_T1, _T2>& x, compressed_pair<_T1, _T2>& y)

^

/home/dave/s/lp/libcxx/include/memory:2772:17: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:22: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:28: error: use of undeclared identifier 'x'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

/home/dave/s/lp/libcxx/include/memory:2772:44: error: '_Tp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:17: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:49: error: '_Dp' does not refer to a value
swap(unique_ptr<_Tp, _Dp>& x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(y);}

^

/home/dave/s/lp/libcxx/include/memory:2766:28: note: declared here
template <class _Tp, class _Dp>

^

/home/dave/s/lp/libcxx/include/memory:2772:55: error: use of undeclared identifier 'y'
swap(unique_ptr<_Tp, _Dp>&
x, unique_ptr<_Tp, _Dp>& y) _NOEXCEPT {x.swap(__y);}

^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


FAIL: libc++ :: libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp (59774 of 68418)

  • TEST 'libc++ :: libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp' FAILED ****

Script:

: 'COMPILED WITH'; /usr/bin/clang++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp -v -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -Werror -Wall -Wextra -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -std=c++2a -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -latomic -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/shared_ptr_arg.pass.cpp.dir/t.tmp.exe

: 'EXECUTED AS'; /usr/bin/python3.8 /home/dave/s/lp/libcxx/test/../utils/run.py --execdir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/shared_ptr_arg.pass.cpp.dir --codesign_identity "" --env -- /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi/Output/shared_ptr_arg.pass.cpp.dir/t.tmp.exe

Exit Code: 1

Command Output (stderr):

clang version 10.0.0 (Fedora 10.0.0-2.fc32)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name shared_ptr_arg.pass.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -v -nostdinc++ -resource-dir /usr/lib64/clang/10.0.0 -include /tmp/_update_lc/r/projects/libcxx/__config_site -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I /home/dave/s/lp/libcxx/include -I /tmp/_update_lc/r/projects/libcxx/include/c++build -D STDC_FORMAT_MACROS -D STDC_LIMIT_MACROS -D STDC_CONSTANT_MACROS -I /home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /tmp/_update_lc/r/projects/libcxx/test/libcxx/memory/trivial_abi -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o /tmp/shared_ptr_arg-ab833e.o -x c++ /home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/dave/s/lp/libcxx/include
/tmp/_update_lc/r/projects/libcxx/include/c++build
/home/dave/s/lp/libcxx/test/support
/usr/local/include
/usr/lib64/clang/10.0.0/include
/usr/include
End of search list.
/home/dave/s/lp/libcxx/test/libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp:27:62: error: unused parameter 'node' [-Werror,-Wunused-parameter]
attribute__((noinline)) bool get_val(std::shared_ptr<Node> node) {

^

1 error generated.



Failed Tests (6):

libc++ :: libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
libc++ :: libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp

Testing Time: 155.37s

Unsupported      : 12664
Passed           : 55604
Expectedly Failed:   144
Failed           :     6

FAILED: CMakeFiles/check-all

I can't take a look at this now to make a quick fix - so I"m reverting this and will look at it next week. Thanks!

P.S: actually, looking at the error message, I think the failures were because of my typo (atribute vs attribute) + other unused variables warnings (which are considered "errors" in those tests).

oontvoo reopened this revision.Jul 4 2020, 11:59 AM
This revision is now accepted and ready to land.Jul 4 2020, 11:59 AM
oontvoo updated this revision to Diff 275516.Jul 4 2020, 11:59 AM

Rolling forward + fix typos and unused variables in tests

phosek added a subscriber: phosek.Jul 5 2020, 1:53 PM

Rolling forward + fix typos and unused variables in tests

This is causing an assertion failure with tip-of-tree Clang:

[485/749] Building CXX object libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.obj
FAILED: libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.obj 
/b/s/w/ir/k/recipe_cleanup/clangew4FcF/llvm_build_dir/./bin/clang++ --target=x86_64-unknown-fuchsia --sysroot=/b/s/w/ir/k/cipd/sdk/arch/x64/sysroot  -DNDEBUG -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilibcxx/include/c++build -I/b/s/w/ir/k/llvm-project/libcxx/include -I/b/s/w/ir/k/cipd/sdk/pkg/fdio/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -ffunction-sections -fdata-sections -ffile-prefix-map=/b/s/w/ir/k/recipe_cleanup/clangew4FcF/llvm_build_dir/runtimes/runtimes-x86_64-unknown-fuchsia-bins=../recipe_cleanup/clangew4FcF/llvm_build_dir/runtimes/runtimes-x86_64-unknown-fuchsia-bins -ffile-prefix-map=/b/s/w/ir/k/llvm-project/= -no-canonical-prefixes -O2 -g  -fPIC   -DLIBCXX_BUILDING_LIBCXXABI -UNDEBUG -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -Wall -Wextra -W -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wno-user-defined-literals -Wno-covered-switch-default -Wno-ignored-attributes -Wno-error -include /b/s/w/ir/k/recipe_cleanup/clangew4FcF/llvm_build_dir/runtimes/runtimes-x86_64-unknown-fuchsia-bins/libcxx/__config_site -std=c++14 -MD -MT libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.obj -MF libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.obj.d -o libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.obj -c /b/s/w/ir/k/llvm-project/libcxx/src/any.cpp
clang++: clang/include/clang/AST/DeclCXX.h:680: bool clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted() const: Assertion `(!needsOverloadResolutionForCopyConstructor() || (data().DeclaredSpecialMembers & SMF_CopyConstructor)) && "this property has not yet been computed by Sema"' failed.
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
oontvoo added a comment.EditedJul 5 2020, 7:10 PM

Does this only happen on Fuchsia? How do I repro it?

(I've run the tests make check-cxx and didn't see any issue)

Thanks!

P.S:

I've tried the following (w/o the fuchsia stuff) and couldn't reproduce it :

 ./bin/clang++ -stdlib=libc++ -nostdinc++  \
   -L$LIBCXX_CHECKOUT/build/lib  \
   -I$LIBCXX_CHECKOUT/build/include/c++/v1 -DDEBUG \
-D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Werror=date-time  -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Wno-user-defined-literals -ffunction-sections -fdata-sections -O2 -g  -fPIC -DLIBCXX_BUILDING_LIBCXXABI  -std=c++14 -MD  -UNDEBUG ../libcxx/src/any.cpp 
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

I hit this assertion in a couple of testcases when running check-all on trunk now:

clang-11: /repo/uabelho/master/clang/include/clang/AST/DeclCXX.h:680: bool clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted() const: Assertion `(!needsOverloadResolutionForCopyConstructor() || (data().DeclaredSpecialMembers & SMF_CopyConstructor)) && "this property has not yet been computed by Sema"' failed.

I get it for a couple of testcases:

Failed Tests (4):

libc++ :: libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
libc++ :: libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp

A whole bunch of buildbots seems to have failed as well (in different ways).
E.g.
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/227/steps/test-libc%2B%2B/logs/FAIL%3A%20libc%2B%2B%3A%3Aunique_ptr_arg.pass.cpp
hit the same assertion as I see.
How about reverting again?

Does this only happen on Fuchsia? How do I repro it?

I don't know if it's just Fuchsia, but we use the unstable libc++ ABI by default and we always do a 2-stage build which is probably why we're seeing this on our builders but not on others.

You can see all the steps on Fuchsia buildbot builder, e.g. http://lab.llvm.org:8011/builders/fuchsia-x86_64-linux/builds/7643

(I've run the tests make check-cxx and didn't see any issue)

Thanks!

P.S:

I've tried the following (w/o the fuchsia stuff) and couldn't reproduce it :

 ./bin/clang++ -stdlib=libc++ -nostdinc++  \
   -L$LIBCXX_CHECKOUT/build/lib  \
   -I$LIBCXX_CHECKOUT/build/include/c++/v1 -DDEBUG \
-D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -fvisibility-inlines-hidden -Werror=date-time  -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Wno-user-defined-literals -ffunction-sections -fdata-sections -O2 -g  -fPIC -DLIBCXX_BUILDING_LIBCXXABI  -std=c++14 -MD  -UNDEBUG ../libcxx/src/any.cpp 
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
ldionne requested changes to this revision.Jul 6 2020, 6:41 AM

I am suspecting the author did not run the tests with the unstable ABI enabled, which is to say the tests were never run. Otherwise a typo would not have gotten through. @oontvoo Please test this properly, update this patch with the fixed result that you'd like to commit. Then, I'll download the patch, run some basic tests on my side and commit it.

This revision now requires changes to proceed.Jul 6 2020, 6:41 AM

Of course, running into the problem also requires an asserts-enabled build of clang, because this change has triggered a Clang bug, which will need to be fixed before this can be recommitted.

All of the testing we did inside google previously for adding trivial_abi was all on a release build of clang, so we didn't trigger the assert there. :(

Sorry for the sloppy testing. I initially ran these tests with google internal checkout+build systems because it was faster and just patched the tests over here once they passed (hence missing the typo in the code here). The fact that we had previously tested this change with a large set of internal code made me incorrectly assume it was safe. I hadn't realised assertion was turnt off.

Anyway, I think the "Fix" here would be in clang. It crashed while trying to determine whether the copy and move ctors were deleted in clang::Sema::checkIllFormedTrivialABIStruct. (Sent D83263 )

I'll let you know once that is resolved

Sorry for the sloppy testing. I initially ran these tests with google internal checkout+build systems because it was faster and just patched the tests over here once they passed (hence missing the typo in the code here). The fact that we had previously tested this change with a large set of internal code made me incorrectly assume it was safe. I hadn't realised assertion was turnt off.

Anyway, I think the "Fix" here would be in clang. It crashed while trying to determine whether the copy and move ctors were deleted in clang::Sema::checkIllFormedTrivialABIStruct. (Sent D83263 )

I'll let you know once that is resolved

Thanks, I'll be waiting for you to ping this again!

Sorry for the sloppy testing. I initially ran these tests with google internal checkout+build systems because it was faster and just patched the tests over here once they passed (hence missing the typo in the code here). The fact that we had previously tested this change with a large set of internal code made me incorrectly assume it was safe. I hadn't realised assertion was turnt off.

Anyway, I think the "Fix" here would be in clang. It crashed while trying to determine whether the copy and move ctors were deleted in clang::Sema::checkIllFormedTrivialABIStruct. (Sent D83263 )

I'll let you know once that is resolved

Thanks, I'll be waiting for you to ping this again!

The crash bug patch has been submitted. PTAL. Thanks!

We'll need to add // UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 on the tests with a short comment explaining there was a segfault.

We'll need to add // UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 on the tests with a short comment explaining there was a segfault.

Do we also need to document more specifically what the breakages might be?

Found another crash:

in void clang::CodeGen::CodeGenFunction::EmitAggregateCopy(clang::CodeGen::LValue, clang::CodeGen::LValue, clang::QualType, AggValueSlot::Overlap_t, bool): (Record->hasTrivialCopyConstructor() || Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"


    @     0x561f6da01ac6  __assert_fail
    @     0x561f69be8e01  clang::CodeGen::CodeGenFunction::EmitAggregateCopy()
    @     0x561f69c73a60  clang::CodeGen::CodeGenFunction::EmitReturnOfRValue()
    @     0x561f69ce03ad  clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk()
    @     0x561f69ce0c6d  clang::CodeGen::CodeGenFunction::generateThunk()
    @     0x561f69ce11f6  clang::CodeGen::CodeGenVTables::maybeEmitThunk()
    @     0x561f69ce1614  clang::CodeGen::CodeGenVTables::EmitThunks()

With

#include <memory>

class DataClass {
 public:
  DataClass();
  ~DataClass();

  // No copy or assign
  DataClass(const DataClass&) = delete;
  DataClass& operator=(const DataClass&) = delete;
};

class AInterface {
 public:
  AInterface() {}
  virtual ~AInterface(){};
  virtual int root_path() const = 0;
};

class BInterface {
 public:
  virtual ~BInterface(){};
  virtual std::shared_ptr<DataClass> sharable_data() = 0;
};

class Child : public AInterface, public BInterface {
 public:
  std::shared_ptr<DataClass> sharable_data() override;

};

std::shared_ptr<DataClass> Child::sharable_data() {
  return std::shared_ptr<DataClass>(nullptr);
}

We'll need to add // UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 on the tests with a short comment explaining there was a segfault.

We'll need to add // UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 on the tests with a short comment explaining there was a segfault.

Do we also need to document more specifically what the breakages might be?

No.

Found another crash:

Please fix it and we'll need to wait for it to land in trunk before we check this patch in. Basically, this patch needs to work on at least one compiler in order to be checked in.

oontvoo updated this revision to Diff 277842.Jul 14 2020, 8:32 AM

Added UNSUPPORTED comments on tests.

Re: the crash in codegen
It's already been fixed (presumably by D82513)

ldionne accepted this revision.Jul 14 2020, 11:19 AM
This revision is now accepted and ready to land.Jul 14 2020, 11:19 AM
EricWF accepted this revision.Jul 15 2020, 7:41 AM

LGTM as well. Thanks for working on this!

Thanks, everyone, for your input (and patience)!
I'm planning on committing this at the beginning of next week. If anyone has some concern or additional testing they'd like to see happen, please let me know.
(Have run the check-cxx with -DLIBCXX_ABI_UNSTABLE=true)

Would be good not to have to roll this back the third time. :-)

Thanks, everyone, for your input (and patience)!
I'm planning on committing this at the beginning of next week. If anyone has some concern or additional testing they'd like to see happen, please let me know.
(Have run the check-cxx with -DLIBCXX_ABI_UNSTABLE=true)

Would be good not to have to roll this back the third time. :-)

-DLIBCXX_ABI_UNSTABLE=ON?

! In D82490#2155964, @ldionne wrote:
-DLIBCXX_ABI_UNSTABLE=ON?

Hmm, I would've assumed it shouldn't matter ( in the CMakeCache.txt file, there's an assortment of ON, OFF, FALSE and TRUE for the BOOL flags)
But doesn't hurt to check.

$ cmake -DLIBCXX_ABI_UNSTABLE=ON -DCMAKE_C_COMPILER=clang    -DCMAKE_CXX_COMPILER=clang++     -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi"  ../llvm
<....clipped ...>
$ make check-cxx
<...... clipped ....>
Testing Time: 751.38s
  Unsupported      :  182
  Passed           : 6138
  Expectedly Failed:   72

! In D82490#2155964, @ldionne wrote:
-DLIBCXX_ABI_UNSTABLE=ON?

Hmm, I would've assumed it shouldn't matter ( in the CMakeCache.txt file, there's an assortment of ON, OFF, FALSE and TRUE for the BOOL flags)
But doesn't hurt to check.

I'm just not 100% sure CMake handles lowercase true as a ON value. It probably does.

! In D82490#2155964, @ldionne wrote:
-DLIBCXX_ABI_UNSTABLE=ON?

Hmm, I would've assumed it shouldn't matter ( in the CMakeCache.txt file, there's an assortment of ON, OFF, FALSE and TRUE for the BOOL flags)
But doesn't hurt to check.

I'm just not 100% sure CMake handles lowercase true as a ON value. It probably does.

Yup, it works either way. From https://cmake.org/cmake/help/latest/command/if.html#condition-syntax:

True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND. Named boolean constants are case-insensitive.

Yup, it works either way. From https://cmake.org/cmake/help/latest/command/if.html#condition-syntax:

True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND. Named boolean constants are case-insensitive.

Ah ah! Thanks!

oontvoo closed this revision.Jul 20 2020, 9:01 AM
MaskRay added a subscriber: MaskRay.EditedJul 20 2020, 9:36 AM

@oontvoo 76887bc4c102a73669a95002d6a06121e7515e68 may not be added to Commits of this differential revision because you indented Differential Revision: https://reviews.llvm.org/D82490 No action item. Please just be aware of this next time.

@davezarzycki Please place large chunk of paste output inside code block quotes, otherwise it is very difficult to read the log from a web UI.

P.S: This broke GCC build bot. Fixed forward in https://reviews.llvm.org/D84183

mstorsjo added inline comments.
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
14

@ontvoo - This doesn't seem to match actual observed behaviour here; now that we actually have Windows/MSVC CI, this test has ended up with an XFAIL: LIBCXX-WINDOWS-FIXME.

When I test running this testcase built with clang-cl, I get the same destruction order (A, B, C) regardless of whether the _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI define is set or not.

Can you have a look and revisit the comment so it matches actual observed behaviour, and change the XFAIL: LIBCXX-WINDOWS-FIXME into something more specific?

oontvoo added inline comments.Jul 15 2021, 12:09 PM
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
14

Honestly I don't remember why I'd written this comment - maybe there was some subtlety there or maybe I was just being confused.

But yeah, in retrospect now, the destruction order should be the same (A,B,C) for MSVC regardless.
I'll update the tests.

oontvoo added inline comments.Jul 15 2021, 12:53 PM
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
14