<div dir="ltr">(this is a request for discussion of how to handle this problem on a principled level)<div>Context: currently, there are bugs in clang regarding the lifetime handling of FileManager / vfs::FileSystem.<br><div><div>Owen has started to send out patches to fix the issues by migrating the uses to IntrusiveRefCntPtr and shared_ptr respectively.</div></div></div><div><br></div><div>Chandler has mentioned that he considers most uses of shared pointers in clang bugs; looking into it, it seems that:</div><div>- most people would expect FileManager/vfs::FileSystem to have a larger scope than basically anything else in clang (hence the bugs)</div><div>- the underlying life-time problems seem to come from design issues in ASTUnit, which are potentially expensive to fix</div><div>- we currently have bugs; fixing bugs is good ...</div><div><br></div><div>The question is: how do we proceed - is the right thing to do to fix the bugs as quickly as possible by introducing more use of shared pointers, or do we want to require addressing the underlying design problem?</div><div>Usually I'd tend to say "let's fix the bug first, and address the design issue later", but I'm concerned that fixing the bugs will lead to not enough pain being left for anybody to ever address the design problems :(</div><div><br></div><div>Thoughts?</div><div>/Manuel</div><div><br></div></div>