[PATCH] D13853: clang-format: Treat --sort-includes that #include and #import mean the same thing.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 18 19:02:10 PDT 2015


thakis added inline comments.

================
Comment at: lib/Format/Format.cpp:1735
@@ -1734,3 +1734,3 @@
   llvm::Regex IncludeRegex(
-      R"(^[\t\ ]*#[\t\ ]*include[^"<]*(["<][^">]*[">]))");
+      R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">]))");
   SmallVector<StringRef, 4> Matches;
----------------
llvm's Regex class doesn't support non-capturing groups (`(?:foo|bar)`) as far as I can tell, so I changed Matches[1] to Matches[2] below.


http://reviews.llvm.org/D13853





More information about the cfe-commits mailing list