[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2017-02-07 Thread Richard Smith via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Parse/ParseDecl.cpp:2702 DS.SetRangeStart(Tok.getLocation()); -DS.SetRangeEnd(SourceLocation()); +DS.SetRangeEnd(Tok.getLocation()); } This doesn't look right: this is a source range containing

[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-12-08 Thread Erik Verbruggen via Phabricator via cfe-commits
erikjv updated this revision to Diff 80735. https://reviews.llvm.org/D21075 Files: lib/Parse/ParseDecl.cpp lib/Sema/SemaExpr.cpp test/Index/diagnostic-ranges.cpp Index: test/Index/diagnostic-ranges.cpp === --- /dev/null +++

[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-10-27 Thread Manuel Klimek via cfe-commits
klimek added a comment. > It's mostly about how much is "underlined". If there is only a caret, that > quite often translates into a single character being pointed out, instead of > an identifier (i.e. the first character). Hene the extension of the range. Aren't we mostly doing token

[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-10-26 Thread Erik Verbruggen via cfe-commits
erikjv added inline comments. Comment at: lib/Sema/SemaExpr.cpp:2061-2062 + auto Builder = Diag(R.getNameLoc(), diagnostic) << Name; + if (Name.isIdentifier()) +Builder << SourceRange(R.getNameLoc()); return true; rsmith wrote: > I'm indifferent on this

[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-10-26 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaExpr.cpp:2061-2062 + auto Builder = Diag(R.getNameLoc(), diagnostic) << Name; + if (Name.isIdentifier()) +Builder << SourceRange(R.getNameLoc()); return true; I'm indifferent on this change: I don't

Re: [PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-07-06 Thread Manuel Klimek via cfe-commits
klimek added a reviewer: rsmith. Comment at: lib/Sema/SemaType.cpp:1339 @@ +1338,3 @@ +auto R = DS.getSourceRange(); +if (R.getEnd().isInvalid()) + R.setEnd(R.getBegin()); erikjv wrote: > klimek wrote: > > Do you know in which cases we

Re: [PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-07-05 Thread Erik Verbruggen via cfe-commits
erikjv added a comment. I'll add tests in the next diff, but I'd like to know if these changes are ok. Comment at: lib/Sema/SemaType.cpp:1339 @@ +1338,3 @@ +auto R = DS.getSourceRange(); +if (R.getEnd().isInvalid()) + R.setEnd(R.getBegin());

Re: [PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-06-28 Thread Manuel Klimek via cfe-commits
klimek added inline comments. Comment at: lib/Sema/SemaType.cpp:1339 @@ +1338,3 @@ +auto R = DS.getSourceRange(); +if (R.getEnd().isInvalid()) + R.setEnd(R.getBegin()); Do you know in which cases we get source ranges that are half valid?

[PATCH] D21075: Correct invalid end location in diagnostics for some identifiers.

2016-06-07 Thread Erik Verbruggen via cfe-commits
erikjv created this revision. erikjv added reviewers: bkramer, klimek. erikjv added a subscriber: cfe-commits. Declaration names in DeclSpec had only their start set to a valid location, so when the type specifier was missing, only the carret would be shown at the first character of the name of a