Open smcpeak opened 1 year ago
@llvm/issue-subscribers-clang-frontend
This issue started as a question on Stack Overflow: https://stackoverflow.com/questions/76924637/how-to-find-the-clangsourcerange-of-a-deleted-function .
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
1) Assign the issue to you.
2) Fix the issue locally.
3) Run the test suite locally.
3.1) Remember that the subdirectories under test/
create fine-grained testing targets, so you can
e.g. use make check-clang-ast
to only run Clang's AST tests.
4) Create a git
commit
5) Run git clang-format HEAD~1
to format your changes.
6) Submit the patch to Phabricator.
6.1) Detailed instructions can be found here
For more instructions on how to submit a patch to LLVM, see our documentation.
If you have any further questions about this issue, don't hesitate to ask via a comment on this Github issue.
@llvm/issue-subscribers-good-first-issue
Hii @smcpeak ! I'm new to open source and would like to work on this issue. How do i assign this issue to myself?
@nox1134 As far as I know, you have to have write access to the repository to assign an issue, per Assigning issues and pull requests to other GitHub users. But I take it from the Developer Policy that granting direct write access is unusual (understandably). So I don't know how to follow the bot's instructions above, sorry! I haven't made any contributions to LLVM myself.
Perhaps @cor3ntin could advise.
Hi everyone, if no one is working on this issue, I would like to take up this issue and work on it. Please assign the issue to me.
Thanks Rajkumar Ananthu.
Problem
For this translation unit:
the source range of
delfunc
should cover the entire text to the finale
indelete
, but when using Clang 16.0.0 (and also a recent-ish trunk build from source), it does not:The same thing happens for methods defined outside their class body:
where
col:13
should becol:23
.Suspected origin
Commit 5f4d76efd365c (2015-03-23) addressed a similar issue for declarations in the class body in
ParseCXXInlineMethods.cpp
, but did not change the handling of those outside class bodies inParser.cpp
.Rough sketch of a fix
The following diff handles the simple testcases above. However, it does not handle templates, and I don't know enough about the parser to fix that myself. I also have not done any testing with real code. So, this diff is merely evidence that something in this vicinity probably needs to change rather than a serious proposal for exactly how to change it.