Marshall Clow via llvm-dev
2017-Jan-23 21:32 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
The upcoming C++1z (probably C++17) standard will not contain several things - most notably auto_ptr. Soon, libc++ will not be providing auto_ptr by default when building in C++1z mode. You'll be able to get it back with a "-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" on your command line, or "#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" before including any libc++ header files. Grepping through the LLVM code base, I found several references to auto_ptr that should be investigated. Most, if not all of them are in test cases. # Tests that reference auto_ptr llvm/test/CodeGen/X86/negate-add-zero.ll llvm/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll llvm/test/Transforms/MemCpyOpt/loadstore-sret.ll # Things that define their own auto_ptr llvm/tools/clang/test/Analysis/diagnostics/Inputs/include/report-issues-within-main-file.h llvm/tools/clang/test/Analysis/diagnostics/report-issues-within-main-file.cpp llvm/tools/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp # clang-tidy bits that reference auto_ptr llvm/tools/clang/tools/extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp llvm/tools/clang/tools/extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h llvm/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-use-emplace.rst llvm/tools/clang/tools/extra/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp llvm/tools/clang/tools/extra/test/clang-tidy/Inputs/modernize-replace-auto-ptr/memory.h llvm/tools/clang/tools/extra/test/clang-tidy/modernize-replace-auto-ptr.cpp llvm/tools/clang/www/analyzer/potential_checkers.html The first three files should be investigated. I believe that the second group should not be affected by this change. The third group (the clang-tidy changes) probably will not be affected. -- Marshall -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170123/5aaf6520/attachment-0001.html>
Michael Kuperstein via llvm-dev
2017-Jan-24 00:09 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
Thanks Marshall, Regarding the first group - these are all LLVM IR-level optimizer tests, so they don't actually care about what a particular version of C++ does or does not contain. Thanks, Michael On Mon, Jan 23, 2017 at 1:32 PM, Marshall Clow via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The upcoming C++1z (probably C++17) standard will not contain several > things - most notably auto_ptr. > > Soon, libc++ will not be providing auto_ptr by default when building in > C++1z mode. > You'll be able to get it back with a > "-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" on your command line, or > "#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" before including any > libc++ header files. > > Grepping through the LLVM code base, I found several references to > auto_ptr that should be investigated. Most, if not all of them are in test > cases. > > # Tests that reference auto_ptr > llvm/test/CodeGen/X86/negate-add-zero.ll > llvm/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll > llvm/test/Transforms/MemCpyOpt/loadstore-sret.ll > > # Things that define their own auto_ptr > llvm/tools/clang/test/Analysis/diagnostics/Inputs/ > include/report-issues-within-main-file.h > llvm/tools/clang/test/Analysis/diagnostics/report- > issues-within-main-file.cpp > llvm/tools/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp > > # clang-tidy bits that reference auto_ptr > llvm/tools/clang/tools/extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp > llvm/tools/clang/tools/extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h > llvm/tools/clang/tools/extra/docs/clang-tidy/checks/ > modernize-use-emplace.rst > llvm/tools/clang/tools/extra/include-fixer/find-all- > symbols/STLPostfixHeaderMap.cpp > llvm/tools/clang/tools/extra/test/clang-tidy/Inputs/ > modernize-replace-auto-ptr/memory.h > llvm/tools/clang/tools/extra/test/clang-tidy/modernize- > replace-auto-ptr.cpp > llvm/tools/clang/www/analyzer/potential_checkers.html > > > The first three files should be investigated. > I believe that the second group should not be affected by this change. > The third group (the clang-tidy changes) probably will not be affected. > > -- Marshall > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170123/20640c2d/attachment-0001.html>
Stephen Checkoway via llvm-dev
2017-Jan-24 01:34 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
> On Jan 23, 2017, at 15:32, Marshall Clow via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > The upcoming C++1z (probably C++17) standard will not contain several things - most notably auto_ptr.Purely for my own edification, is the rationale for this available somewhere? Thank you, Steve -- Stephen Checkoway
Roel Jordans via llvm-dev
2017-Jan-24 09:43 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
On 24-01-17 02:34, Stephen Checkoway via llvm-dev wrote:>> On Jan 23, 2017, at 15:32, Marshall Clow via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> The upcoming C++1z (probably C++17) standard will not contain several things - most notably auto_ptr. > Purely for my own edification, is the rationale for this available somewhere?According to [1] it has been deprecated since C++11 and using unique_ptr should be prefered. Cheers, Roel [1] http://www.cplusplus.com/reference/memory/auto_ptr/
Eric Fiselier via llvm-dev
2017-Jan-24 10:03 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
On Mon, Jan 23, 2017 at 6:34 PM, Stephen Checkoway via llvm-dev < llvm-dev at lists.llvm.org> wrote:> > > On Jan 23, 2017, at 15:32, Marshall Clow via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > The upcoming C++1z (probably C++17) standard will not contain several > things - most notably auto_ptr. > > Purely for my own edification, is the rationale for this available > somewhere? >Here is a draft of the paper <https://isocpp.org/files/papers/N4190.txt> which removed it. The short and sweet rational for it is that auto_ptr was designed before C++ had move semantics. and because of that it doesn't behave like a move-only type should and is unsafe because of it.> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170124/d3ee29e1/attachment.html>
Marshall Clow via llvm-dev
2017-Jan-24 22:34 UTC
[llvm-dev] Upcoming removal of std::auto_ptr (in C++1z)
On Mon, Jan 23, 2017 at 1:32 PM, Marshall Clow <mclow.lists at gmail.com> wrote:> The upcoming C++1z (probably C++17) standard will not contain several > things - most notably auto_ptr. > > Soon, libc++ will not be providing auto_ptr by default when building in > C++1z mode. > You'll be able to get it back with a > "-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" on your command line, or > "#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" before including any > libc++ header files. > >Landed as revision 292986. -- Marshall -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170124/82dc9404/attachment.html>