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

GCC header map lists some private headers as public

Originally reported on Google Code with ID 88


tr1/functional_hash.h and tr1/hashtable.h are both listed as public. However, looking
at the comments of those headers it's pretty clear they they are intended to be private
headers, see:
http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01894.html
http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01876.html



Reported by christopherberner on 2012-12-28 19:37:21

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

  • 写回答

11条回答 默认 最新

  • weixin_39822993 2020-11-30 11:25
    关注
    
    Thanks!
    
    I noticed you just marked the two headers as private -- do they map to a public header
    somewhere?
    
    I'm not sure what IWYU's policy is if all defining headers are private... Could you
    test with a simple .cc file like this;
    
      #include <tr1>
      #include <tr1>
    
      std::hash<int> h; // from functional_hash.h
      std::_Hashtable<...> ht; // from hashtable.h
    
    I'm guessing the expected behavior here is to replace both #includes with <tr1>.
    
    
    </tr1></...></int></tr1></tr1>

    Reported by kim.grasman on 2012-12-29 13:12:52

    评论

报告相同问题?