| Summary: | Strange warning placement for defaulted constructor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> | ||||
| Component: | cdt-parser | Assignee: | Nathan Ridge <zeratul976> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin, malaperle, yevshif | ||||
| Version: | 8.0.1 | ||||||
| Target Milestone: | 8.1.2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 223589 [details]
patch that fixes the issue, including tests
The problem was that the parser was not setting the begin offset of the ASTNode representing the defaulted function definition, so the offset was 0, and so Codan placed the warning on the first line of the file.
Attached is a patch that fixes the problem, with tests.
Patch is now on gerrit: https://git.eclipse.org/r/#/c/9065/ The patch committed as http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=8cf540fbf6f9d5bcb5a8387b63bfd6c281f0784a. *** cdt git genie on behalf of Nathan Ridge ***
Bug 365498 - Strange warning placement for defaulted constructor
Change-Id: Ia80fbd9694310aff0900e80cb9175e101c653604
Reviewed-on: <a href="https://git.eclipse.org/r/9065">https://git.eclipse.org/r/9065</a>
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
Tested-by: Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx>
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1289cc3a6e98b216ce687901dbc9fcca1c441e30
Comment on attachment 223589 [details]
patch that fixes the issue, including tests
Captured with git commit.
|
When codan gives a gives a warning about a defaulted constructor, such as the following: // some comment <-- WARNING HERE struct S { int i; S() = default; }; The warning is always on the first line of the file rather than the line with the defaulted constructor, regardless of what the first line of the file is.