lodha1503 wrote:

@AaronBallman 

Source range for = delete / = default

Per your suggestion, switched to PrevTokLocation unconditionally for the range 
end (Parser.cpp + ParseCXXInlineMethods.cpp), for both = delete/= default, with 
or without a message. No more getLocForEndOfToken/MeasureTokenLength arithmetic 
— PrevTokLocation is tracked natively as tokens are consumed, so it can't 
corrupt macro locations. Fixes the crash cleanly and matches the existing 
SetRangeEnd(PrevTokLocation) idiom used elsewhere (ParseExprCXX.cpp).

Note: this moves the range end from end-of-token to start-of-token for the 
no-message case.

8 pre-existing tests updated to match the new column values (all taken from 
actual rebuilt-compiler output, not hand-computed): SourceLocationTest.cpp, 
RecursiveASTVisitorTests/CXXMethodDecl.cpp (worth a look — Sema reuses 
getEndLoc() for compiler-synthesized code in implicit defaulted special 
members, so this shifts those too), ast-dump-decl.cpp, ast-dump-funcs.cpp, 
ast-dump-record-definition-data-json.cpp, the analyzer's path-notes.cpp.plist 
golden file, CoverageMapping/default-method.cpp, and this PR's own test.

Full check-clang suite: 0 failures (53,909 tests).


https://github.com/llvm/llvm-project/pull/205408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to