[PATCH] D17990: [clang-tidy] minor improvements in modernise-deprecated-headers check
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 9 08:42:10 PDT 2016
alexfh requested changes to this revision.
This revision now requires changes to proceed.
================
Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:55
@@ +54,3 @@
+ CStyledHeaderToCxx =
+ {{"assert.h", "cassert"},
+ {"complex.h", "complex"},
----------------
It might not work on MSVC2013. You can try submitting this, but please watch the buildbots closely and have an alternative patch ready to fix the issue.
================
Comment at: clang-tidy/modernize/DeprecatedHeadersCheck.cpp:85
@@ -78,2 +84,3 @@
}
+ DeleteHeaders = {"stdalign.h", "stdbool.h", "iso646.h"};
}
----------------
ditto
================
Comment at: test/clang-tidy/modernize-deprecated-headers-cxx03.cpp:5
@@ -4,1 +4,3 @@
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: inclusion of deprecated C++ header 'assert.h'; consider using 'cassert' instead [modernize-deprecated-headers]
+// CHECK-FIXES: #include <cassert>
#include <complex.h>
----------------
Please anchor the patterns to the start and end of line.
================
Comment at: test/clang-tidy/modernize-deprecated-headers-cxx03.cpp:60
@@ -27,2 +59,3 @@
#include <stdalign.h>
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdalign.h' has no effect in C++; consider removing it
#include <stdbool.h>
----------------
Please add a comment after the #include and add a CHECK-FIXES to ensure the whole #include directive is removed.
================
Comment at: test/clang-tidy/modernize-deprecated-headers-cxx03.cpp:131
@@ +130,3 @@
+#include "stdalign.h"
+// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: including 'stdalign.h' has no effect in C++; consider removing it
+#include "stdbool.h"
----------------
Add proper CHECK-FIXES here as well.
The same for the other test file.
https://reviews.llvm.org/D17990
More information about the cfe-commits
mailing list