[all-commits] [llvm/llvm-project] 1e48ef: Implement #pragma clang final extension

Chris B via All-commits all-commits at lists.llvm.org
Mon Sep 27 12:11:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e48ef20358fb097f43d9b133e33bd23723d79c2
      https://github.com/llvm/llvm-project/commit/1e48ef20358fb097f43d9b133e33bd23723d79c2
  Author: Chris Bieneman <chris.bieneman at me.com>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticLexKinds.td
    M clang/include/clang/Basic/IdentifierTable.h
    M clang/include/clang/Lex/Preprocessor.h
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Lex/Pragma.cpp
    M clang/lib/Lex/Preprocessor.cpp
    A clang/test/Lexer/Inputs/final-macro.h
    M clang/test/Lexer/Inputs/unsafe-macro.h
    M clang/test/Lexer/deprecate-macro.c
    A clang/test/Lexer/final-macro.c
    M clang/test/Lexer/pedantic-macro-interplay.c

  Log Message:
  -----------
  Implement #pragma clang final extension

This patch adds a new preprocessor extension ``#pragma clang final``
which enables warning on undefinition and re-definition of macros.

The intent of this warning is to extend beyond ``-Wmacro-redefined`` to
warn against any and all alterations to macros that are marked `final`.

This warning is part of the ``-Wpedantic-macros`` diagnostics group.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list