[PATCH] D12017: Fix IncludeInserter/IncludeSorter bug.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 14 03:36:00 PDT 2015


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Thanks for fixing this! Looks good with a comment.


================
Comment at: clang-tidy/IncludeSorter.cpp:118
@@ +117,3 @@
+  if (SourceLocations.empty()) {
+    // If there are no includes in this file, add it in the first line.
+    IncludeStmt.append("\n");
----------------
Ideally, it should start inserting #includes after the file comment (if present) and after the header include guard (if present, and if it ever inserts includes in headers). This is kind of a corner case, but please at least add a FIXME.


http://reviews.llvm.org/D12017





More information about the cfe-commits mailing list