summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab
Commit message (Collapse)AuthorAgeFilesLines
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Support tests in freestandingJF Bastien2019-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-211-1/+1
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-151-1/+1
| | | | | | https://reviews.llvm.org/D39080 llvm-svn: 318277
* [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.Stephan T. Lavavej2017-08-051-1/+1
| | | | llvm-svn: 310156
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-291-1/+1
| | | | llvm-svn: 309464
* [libcxx] [test] Remove an unused local typedef in ↵Stephan T. Lavavej2017-07-271-1/+0
| | | | | | | | enable_shared_from_this.pass.cpp. Trivial change, committed without review. llvm-svn: 309322
* Fix enable_shared_from_this test in C++11Eric Fiselier2017-05-101-7/+6
| | | | llvm-svn: 302721
* [libc++] Fix PR32979 - types with a private std::enable_shared_from_this ↵Eric Fiselier2017-05-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | base break shared_ptr Summary: This patch fixes bugs.llvm.org/PR32979. [util.smartptr.shared.const] says: > In the constructor definitions below, enables shared_from_this with p, for a pointer p of type Y*, means > that if Y has an unambiguous and accessible base class that is a specialization of enable_shared_from_- > this. This means that libc++ needs to respect the access specifier of the base class, and not attempt to construct and enabled_shared_from_this base if it is private. However access specifiers don't affect overload resolution so our current implementation will attempt to construct the private base. This patch uses SFINAE to correctly detect if the shared_ptr input has an accessible enable_shared_from_this base class. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33033 llvm-svn: 302709
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-171-2/+2
| | | | llvm-svn: 295434
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-181-2/+2
| | | | | | No functional change, no code review. llvm-svn: 292434
* Fix C++03 failure in enable_shared_from_this testEric Fiselier2016-06-271-1/+2
| | | | llvm-svn: 273836
* Fix PR27115 - enable_shared_from_this does not work as a virtual base class.Eric Fiselier2016-06-261-0/+16
| | | | | | | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=27115 The problem was that the conversion from 'const enable_shared_from_this<T>*' to 'const T*' didn't work if T inherited enable_shared_from_this as a virtual base class. The fix is to take the original pointer passed to shared_ptr's constructor in the __enable_weak_this method and perform an upcast to 'const T*' instead of performing a downcast from the enable_shared_from_this base. llvm-svn: 273835
* Fix leak in __enable_weak_this(). Thanks to Arthur O'Dwyer for finding it.Eric Fiselier2016-06-021-1/+33
| | | | llvm-svn: 271487
* Remove enable_shared_from_this test since it leaks the control block and ↵Eric Fiselier2016-06-021-26/+0
| | | | | | fails with ASAN llvm-svn: 271459
* Implement P0033R1 - Re-enabling shared_from_thisEric Fiselier2016-06-021-0/+86
| | | | | | | | | | | | Summary: See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19254 llvm-svn: 271449
* Fix PR#18843. Thanks to Howard for the fixMarshall Clow2015-06-191-0/+4
| | | | llvm-svn: 240136
* Move test into test/std subdirectory.Eric Fiselier2014-12-201-0/+49
llvm-svn: 224658
OpenPOWER on IntegriCloud