This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix SelectionTree behavior on constructor init-lists.
ClosedPublic

Authored by sammccall on Nov 15 2019, 7:07 AM.

Details

Summary

For the constructor Foo() : classmember(arg) {}

The AST looks like:

  • CXXCtorInitializer classmember(arg)
    • CXXConstructExpr classmember(arg)
      • DeclRefExpr: arg

We want the 'classmember' to be associated with the CXXCtorInitializer, not the
CXXConstructExpr. (CXXConstructExpr is known to have bad ranges).
So just early-claim it.

Thanks @hokein for tracking down/reducing the bug.

Diff Detail

Event Timeline

sammccall created this revision.Nov 15 2019, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 7:07 AM
hokein accepted this revision.Nov 15 2019, 7:12 AM

Thanks!

This revision is now accepted and ready to land.Nov 15 2019, 7:12 AM

Build result: pass - 60134 tests passed, 0 failed and 729 were skipped.
Log files: console-log.txt, CMakeCache.txt

This revision was automatically updated to reflect the committed changes.