This is an archive of the discontinued LLVM Phabricator instance.

[include-fixer] Don't add missing header if the unindentified symbol isn't from the main file.
ClosedPublic

Authored by hokein on Jun 3 2016, 1:36 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 59496.Jun 3 2016, 1:36 AM
hokein retitled this revision from to [include-fixer] Don't add missing header if the unindentified symbol isn't from the main file..
hokein updated this object.
hokein added a reviewer: bkramer.
hokein added a subscriber: cfe-commits.
bkramer accepted this revision.Jun 3 2016, 3:27 AM
bkramer edited edge metadata.

LG. It's a bit sad but I guess the cases where that legitimately can happen due to template weirdness are far outweighed by the cases where we have a non-self contained header. The cases I've been thinking of are stuff like:

header.h:

template <typename T>
class Foo {
  T t;
};

test.cc:

#include "header.h"

class Bar;
Foo<Bar> f;

Here we'd have to include the header for Bar into test.cc, but figuring that out is hard. Ignoring all of that for now is fine.

This revision is now accepted and ready to land.Jun 3 2016, 3:27 AM
This revision was automatically updated to reflect the committed changes.