[PATCH] D24888: [clang-tidy] Use [[clang::suppress]] with cppcoreguidelines-pro-type-reinterpret-cast

Matthias Gehre via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 23 14:54:28 PDT 2016


mgehre created this revision.
mgehre added reviewers: alexfh, aaron.ballman.
mgehre added a subscriber: cfe-commits.
Herald added a subscriber: nemanjai.

This is a proof-of-concept how the [[clang::suppress(tags,...)]] attribute can
work with suppressing clang-tidy warnings.

The list of tags that can be used to suppress a specific warnings comes
from [1]. It is the group that the cppcoreguidelines check belongs to
("type"), the name of the check there ("type.1") and the clang-tidy
name ("cppcoreguidelines-pro-type-reinterpret-cast").

I envision to put this into all cppcoreguidelines checks. Alternatively,
this could go into clang-tidy core, to have this automatically for all
checks.

I'm looking forward to your comments!

Depends on: D24886

[1] https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#inforce-enforcement

https://reviews.llvm.org/D24888

Files:
  clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp
  clang-tidy/cppcoreguidelines/Suppression.h
  docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.rst
  test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24888.72363.patch
Type: text/x-patch
Size: 6215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160923/2b6251e6/attachment.bin>


More information about the cfe-commits mailing list