[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
Thu Aug 27 16:46:54 PDT 2020


rsmith created this revision.
rsmith added a reviewer: sbenza.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
rsmith requested review of this revision.

For example:

FOO({})

... forms a statement-expression after macro expansion. This warning
applies to '({' and '})' delimiting statement-expressions, '[[' and ']]'
delimiting attributes, and '::*' introducing a pointer-to-member.

The warning for forming these compound tokens across macro expansions
(or across files!) is enabled by default; the warning for whitespace
within the tokens is not, but is included in -Wall.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86751

Files:
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Parse/Parser.h
  clang/lib/Headers/altivec.h
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Parse/ParseStmt.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/Misc/warning-wall.c
  clang/test/Parser/compound-token-split.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86751.288485.patch
Type: text/x-patch
Size: 12175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200827/466dd93c/attachment-0001.bin>


More information about the cfe-commits mailing list