[all-commits] [llvm/llvm-project] de401a: [clang][Sema] Avoid duplicate diagnostics for unre...

Takuya Shimizu via All-commits all-commits at lists.llvm.org
Tue Mar 14 05:44:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de401ac2a4ab74392b8234aa3a517481a1e2762c
      https://github.com/llvm/llvm-project/commit/de401ac2a4ab74392b8234aa3a517481a1e2762c
  Author: Takuya Shimizu <shimizu2486 at gmail.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Analysis/Analyses/ReachableCode.h
    M clang/lib/Analysis/ReachableCode.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    A clang/test/Sema/warn-unreachable-fallthrough.c

  Log Message:
  -----------
  [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

This patch checks whether -Wunreachable-code-fallthrough is enabled
when clang encounters unreachable fallthrough attributes and, if so,
suppresses code will never be executed warning to avoid duplicate
warnings.

Fixes https://github.com/llvm/llvm-project/issues/60416
Differential Revision: https://reviews.llvm.org/D145842




More information about the All-commits mailing list