[PATCH] D74669: [clang-tidy] New check: misc-no-include-cpp

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 16 05:45:15 PST 2020


njames93 added a comment.

I have a feeling this check should be called something along the lines of bugprone-suspicous-include.



================
Comment at: clang-tools-extra/clang-tidy/misc/NoIncludeCPPCheck.cpp:62
+      Check.diag(HashLoc, "suspicious #include")
+          << FixItHint::CreateReplacement(FilenameRange,
+                                          ((IsAngled ? "<" : "\"") + FileName +
----------------
This replacement is dangerous, I have a feeling no fix-it should be provided or at least do a search of the include directories to see if file you are trying to include actually does exist. The correct file could be `*.hpp` like what boost uses for all its header files


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74669/new/

https://reviews.llvm.org/D74669





More information about the cfe-commits mailing list