Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4052

auto_ptr is deprecated and should not be used in our code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.1.0
    • Plugins
    • None

    Description

      I get the following build warnings:

      In file included from ats-multiplexer.cc:29:0:
      dispatch.h:54:8: warning: 'template<class&gt; class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
         std::auto_ptr<ats::io::IO> io;
              ^
      In file included from /opt/gcc5/include/c++/5.2.0/memory:81:0,
                       from dispatch.h:27,
                       from ats-multiplexer.cc:29:
      /opt/gcc5/include/c++/5.2.0/bits/unique_ptr.h:49:28: note: declared here
         template<typename> class auto_ptr;
                                  ^
        CXX      chunk-decoder.lo
        CXX      dispatch.lo
      In file included from dispatch.cc:26:0:
      dispatch.h:54:8: warning: 'template<class&gt; class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
         std::auto_ptr<ats::io::IO> io;
              ^
      In file included from /opt/gcc5/include/c++/5.2.0/memory:81:0,
                       from dispatch.h:27,
                       from dispatch.cc:26:
      /opt/gcc5/include/c++/5.2.0/bits/unique_ptr.h:49:28: note: declared here
         template<typename> class auto_ptr;
                                  ^
        CXX      fetcher.lo
        CXX      original-request.lo
      In file included from original-request.cc:25:0:
      dispatch.h:54:8: warning: 'template<class&gt; class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
         std::auto_ptr<ats::io::IO> io;
              ^
      In file included from /opt/gcc5/include/c++/5.2.0/memory:81:0,
                       from dispatch.h:27,
                       from original-request.cc:25:
      /opt/gcc5/include/c++/5.2.0/bits/unique_ptr.h:49:28: note: declared here
         template<typename> class auto_ptr;
                                  ^
        CXX      post.lo
      In file included from post.h:28:0,
                       from post.cc:26:
      dispatch.h:54:8: warning: 'template<class&gt; class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
         std::auto_ptr<ats::io::IO> io;
              ^
      In file included from /opt/gcc5/include/c++/5.2.0/memory:81:0,
                       from dispatch.h:27,
                       from post.h:28,
                       from post.cc:26:
      /opt/gcc5/include/c++/5.2.0/bits/unique_ptr.h:49:28: note: declared here
         template<typename> class auto_ptr;
      

      I'm not sure what's the best option here, but we've used ats_scoped_obj in plugins even though it's not a public API.

      Attachments

        Activity

          People

            amc Alan M. Carroll
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: