[PATCH] D86751: Add new warning for compound punctuation tokens that are split across macro expansions or split by whitespace.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 13:34:32 PDT 2020


rsmith marked an inline comment as done.
rsmith added inline comments.
Herald added a subscriber: danielkiss.


================
Comment at: clang/test/Parser/compound-token-split.cpp:30
+
+[ // expected-warning-re {{{{^}}'[' tokens introducing attribute appear in different source files}}
+#define LSQUARE
----------------
sbenza wrote:
> Does this count as a "different" source file?
> Or is it just an implementation detail of how clang uses FileIDs ?
:) Yes, this is a consequence of how Clang uses `FileID`s.

I guess it's debatable whether the includer and included file are "different", but I'm hoping no-one will be confused by the diagnostic. (I think it's one of those "if you ever see this diagnostic in practice you win a small prize" cases...)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86751



More information about the cfe-commits mailing list