weixin_39822993 2020-11-30 11:25
浏览 0

iwyu suggests use of the internal header file auto_ptr.h

Originally reported on Google Code with ID 63


This code:

  #include <memory>
  void foo()
  {
    std::auto_ptr<int> i;
  }

gives the following output from iwyu:


foo.cpp should add these lines:
#include <auto_ptr.h>                   // for auto_ptr

foo.cpp should remove these lines:
- #include <memory>  // lines 1-1

The full include-list for foo.cpp:
#include <auto_ptr.h>                   // for auto_ptr


What is the expected output? What do you see instead?

Including memory is ok. auto_ptr.h is an internal libstdc++ header file and should
not be included directly.


What version of the product are you using? On what operating system?

clang version 3.1 (trunk 143346)
Target: x86_64-unknown-linux-gnu





</auto_ptr.h></memory></auto_ptr.h></int></memory>

Reported by jonas.bulow on 2011-11-01 14:34:51

该提问来源于开源项目:include-what-you-use/include-what-you-use

  • 写回答

5条回答 默认 最新

  • weixin_39822993 2020-11-30 11:25
    关注
    
    This should be easy to fix by adding an entry to iwyu_include_picker.cc mapping auto_ptr.h
    to memory.  Would you like to give it a shot and attach a diff here?
    

    Reported by csilvers on 2011-11-02 00:53:15

    评论

报告相同问题?