[all-commits] [llvm/llvm-project] 0e00a9: Add new warning for compound punctuation tokens th...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Aug 28 13:36:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e00a95b4fad5e72851de012d3a0b2c2d01f8685
      https://github.com/llvm/llvm-project/commit/0e00a95b4fad5e72851de012d3a0b2c2d01f8685
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-08-28 (Fri, 28 Aug 2020)

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

  Log Message:
  -----------
  Add new warning for compound punctuation tokens that are split across macro expansions or split by whitespace.

For example:

    #define FOO(x) (x)
    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.

Differential Revision: https://reviews.llvm.org/D86751




More information about the All-commits mailing list