Page MenuHomePhabricator

[include-fixer] Correct nested class search for identifiers with scoped information

Authored by hokein on Aug 1 2016, 11:39 AM.



include-fixer will firstly try to use scoped namespace context information to
search identifier. However, in some cases, it's unsafe to do nested class
search, because it might treat the identifier as a nested class of scoped

Given the following code, and the symbol database only has two classes: "foo" and

namespace foo { Bar t; }

Before getting fixing, include-fixer will never search "Bar" symbol.
Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace,
then it finds "foo" in database finally. So it treats "Bar" is a nested class
of "foo".

Diff Detail


Event Timeline

hokein updated this revision to Diff 66347.Aug 1 2016, 11:39 AM
hokein retitled this revision from to [include-fixer] Correct nested class search for identifiers with scoped information.
hokein updated this object.
hokein added a reviewer: bkramer.
hokein added a subscriber: cfe-commits.
bkramer accepted this revision.Aug 2 2016, 1:57 AM
bkramer edited edge metadata.
bkramer added inline comments.
32 ↗(On Diff #66347)

"tries to strip"

35 ↗(On Diff #66347)

"fails to find"

This revision is now accepted and ready to land.Aug 2 2016, 1:57 AM
hokein updated this revision to Diff 66452.Aug 2 2016, 3:36 AM
hokein edited edge metadata.

Address review comments.

This revision was automatically updated to reflect the committed changes.