Page MenuHomePhabricator

[libc++][NFC] Test span is nothrow trivially destructible
ClosedPublic

Authored by jloser on Sep 4 2021, 9:46 PM.

Details

Summary

Add tests showing span is trivially_destructible and nothrow_destructible.
Note that we do not need to explicitly default the destructor in span.

Diff Detail

Event Timeline

jloser requested review of this revision.Sep 4 2021, 9:46 PM
jloser created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2021, 9:46 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser updated this revision to Diff 370781.Sep 4 2021, 9:47 PM

Explicitly include <type_traits> in test

Mordante added inline comments.Sep 5 2021, 4:28 AM
libcxx/test/std/containers/views/span.cons/span.dtor.pass.cpp
23 ↗(On Diff #370781)

Since the test doesn't execute any code, please rename the file to span.dtor.compile.pass.cpp and rename main to a different name, test for example.

The types of test files used is documented in utils/libcxx/test/format.py

Lit test format for the C++ Standard Library conformance test suite.        

This test format is based on top of the ShTest format -- it basically       
creates a shell script performing the right operations (compile/link/run)   
based on the extension of the test file it encounters. It supports files    
with the following extensions:                                              

FOO.pass.cpp            - Compiles, links and runs successfully             
FOO.pass.mm             - Same as .pass.cpp, but for Objective-C++          

FOO.compile.pass.cpp    - Compiles successfully, link and run not attempted 
FOO.compile.fail.cpp    - Does not compile successfully                     
    
FOO.link.pass.cpp       - Compiles and links successfully, run not attempted
FOO.link.fail.cpp       - Compiles successfully, but fails to link          
    
FOO.sh.<anything>       - A builtin Lit Shell test

FOO.verify.cpp          - Compiles with clang-verify. This type of test is  
                          automatically marked as UNSUPPORTED if the compiler
                          does not support Clang-verify.

FOO.fail.cpp            - Compiled with clang-verify if clang-verify is     
                          supported, and equivalent to a .compile.fail.cpp  
                          test otherwise. This is supported only for backwards
                          compatibility with the test suite.
25 ↗(On Diff #370781)

Can you please remove the unneeded space > >?
Once llvm 13 is released we can use its clang-format which doesn't add the unneeded spaces.

jloser updated this revision to Diff 370830.Sep 5 2021, 3:53 PM

Convert test to compile time only test

jloser marked an inline comment as done.Sep 5 2021, 3:59 PM
jloser added inline comments.
libcxx/test/std/containers/views/span.cons/span.dtor.pass.cpp
23 ↗(On Diff #370781)

Thanks for the info on the different types of tests and showing me where I can always look them up for next time; I often forget about some of the differences.

Just renamed to span.dtor.compile.pass.cpp.

jloser updated this revision to Diff 370831.Sep 5 2021, 4:03 PM

[NFC] Move naked static_asserts into test function

Mordante accepted this revision as: Mordante.Sep 6 2021, 11:25 AM

Thanks, LGTM!

ldionne accepted this revision.Sep 7 2021, 9:40 AM
This revision is now accepted and ready to land.Sep 7 2021, 9:40 AM