This is an archive of the discontinued LLVM Phabricator instance.

[clang] Store the location for invalid type of a declarator.
Needs ReviewPublic

Authored by hokein on Feb 2 2021, 7:26 AM.

Details

Reviewers
sammccall
Summary

Prior to the patch, for an invalid type of declarator, the TInfo's location was
invalid. This patch would improve the tooling (syntax-tree) on handling broken
code.

see the following example:

void test(undef);
// before: ParmVarDecl <col:11, <invalid sloc>> col:16 invalid 'int'
// after: ParmVarDecl <col:11> col:16 invalid 'int'

Diff Detail

Event Timeline

hokein created this revision.Feb 2 2021, 7:26 AM
hokein requested review of this revision.Feb 2 2021, 7:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2021, 7:26 AM

It would be nice to have a testcase with a nontrivial range so we can see the choice of location...

clang/lib/Sema/SemaType.cpp
5659

why endloc rather than start or something else?