Page MenuHomePhabricator

[clangd] Define out-of-line qualify function name
ClosedPublic

Authored by kadircet on Nov 25 2019, 12:44 AM.

Details

Summary

When moving function definitions to a different context, the function
name might need a different spelling, for example in the header it might be:

namespace a {
  void foo() {}
}

And we might want to move it into a context which doesn't have namespace a as
a parent, then we must re-spell the function name, i.e:

void a::foo() {}

This patch implements a version of this which ignores using namespace
declarations in the source file.

Diff Detail

Event Timeline

kadircet created this revision.Nov 25 2019, 12:44 AM
kadircet updated this revision to Diff 230843.Nov 25 2019, 12:46 AM
  • Get rid of debug output

Build result: FAILURE - Could not check out parent git hash "0a2c8c14d3aa16ca964a8e643f9a5bfdd5459de3". It was not found in the repository. Did you configure the "Parent Revision" in Phabricator properly? Trying to apply the patch to the master branch instead...

ERROR: arc patch failed with error code 1. Check build log for details.
Log files: console-log.txt, CMakeCache.txt

Build result: FAILURE - Could not check out parent git hash "0a2c8c14d3aa16ca964a8e643f9a5bfdd5459de3". It was not found in the repository. Did you configure the "Parent Revision" in Phabricator properly? Trying to apply the patch to the master branch instead...

ERROR: arc patch failed with error code 1. Check build log for details.
Log files: console-log.txt, CMakeCache.txt

hokein added inline comments.Nov 29 2019, 2:21 AM
clang-tools-extra/clangd/unittests/TweakTests.cpp
2028

maybe name them TestHeader, and TestSource.

2051

nit: could we keep each string per line? It would improve the code readability here.

kadircet marked 2 inline comments as done.Nov 29 2019, 3:05 AM
kadircet updated this revision to Diff 231512.Nov 29 2019, 3:05 AM
  • Address comments
kadircet updated this revision to Diff 231513.Nov 29 2019, 3:08 AM
  • Update comments after rebase
hokein accepted this revision.Dec 2 2019, 12:26 PM
This revision is now accepted and ready to land.Dec 2 2019, 12:26 PM
This revision was automatically updated to reflect the committed changes.