[PATCH] D17990: [clang-tidy] minor improvements in modernise-deprecated-headers check

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 9 05:26:10 PST 2016


omtcyf0 created this revision.
omtcyf0 added reviewers: alexfh, rsmith, LegalizeAdulthood.
omtcyf0 added a subscriber: cfe-commits.

This patch introduces a minor list of changes as proposed by Richard Smith in the mailing list.

See original comments with an impact on the future check state below:

[comments.begin

> +                          {"complex.h", "ccomplex"},

It'd be better to convert this one to <complex>, or leave it alone.
<ccomplex> is an unnecessary wart.

(The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of
which are identical) aren't comparable to C99's <complex.h>, so if
this was C++98 code using the C99 header, the code will be broken with
or without this transformation.)

> +                          {"iso646.h", "ciso646"},

Just delete #includes of this one. <ciso646> does nothing.

> +              {"stdalign.h", "cstdalign"},
> +              {"stdbool.h", "cstdbool"},

We should just delete these two includes. These headers do nothing in C++.

comments.end]

http://reviews.llvm.org/D17990

Files:
  clang-tidy/modernize/DeprecatedHeadersCheck.cpp
  docs/clang-tidy/checks/modernize-deprecated-headers.rst
  test/clang-tidy/modernize-deprecated-headers-cxx03.cpp
  test/clang-tidy/modernize-deprecated-headers-cxx11.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17990.50125.patch
Type: text/x-patch
Size: 16702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160309/1ed2532b/attachment-0001.bin>


More information about the cfe-commits mailing list