[all-commits] [llvm/llvm-project] 0d6d8a: [clang-tidy] Fix bugprone-assert-side-effect to ac...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Tue May 9 09:45:20 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d6d8a853a6ea29b5f461a475a8f8eb7e7ba18e2
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2023-05-09 (Tue, 09 May 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/AssertSideEffectCheck.cpp
    A clang-tools-extra/test/clang-tidy/checkers/bugprone/Inputs/assert-side-effect/assert.h
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/assert-side-effect.cpp

  Log Message:
  [clang-tidy] Fix bugprone-assert-side-effect to actually give warnings

Some time ago a patch was merged to disable all clang-tidy warnings
from system macros. This led to bugprone-assert-side-effect
silently no longer working, since the warnings came from a system
macro. The problem was not detected because the fake assert functions
were implemented in the same file as the test, instead of being a
system include like it's done in the real world.

Move the assert to a proper system header, and fix the code to
warn at the correct location.

This patch is breakdown from https://reviews.llvm.org/D147081
by PiotrZSL.

Fixes https://github.com/llvm/llvm-project/issues/62314

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

More information about the All-commits mailing list