[PATCH] D75844: [clang] Set begin loc on GNU attribute parsed attrs

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 01:37:09 PDT 2020


tbaeder added a comment.

Sorry for taking so long but it seems like I've went down a rabbit hole a bit. My previous patch sets the range in `parseGNUAttributes()` unconditionally, but that seems to trigger cases such as

  // FixItLoc = possible correct location for the attributes
  void ProhibitAttributes(ParsedAttributesWithRange &Attrs,
                          SourceLocation FixItLoc = SourceLocation()) {
    if (Attrs.Range.isInvalid())
      return;
    DiagnoseProhibitedAttributes(Attrs.Range, FixItLoc);
    Attrs.clear();
  }

in Parser.h. Because now the attributes have a valid range, clang emits lots of errors where it previously did not.

Do you have a suggestion of what to do here, should I rather go back to a more local fix for the issue?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75844/new/

https://reviews.llvm.org/D75844





More information about the cfe-commits mailing list