From: Daniel Jasper Date: Tue, 19 May 2015 11:22:29 +0000 (+0000) Subject: clang-format: Support #include_next X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d42fd2ae0f416b651d5c4d25b7bbe1225ace8d02;p=clang clang-format: Support #include_next Before: #include_next < test.h > After: #include_next This fixes llvm.org/PR23500 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237686 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 772fa1d239..8088ff667e 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -633,6 +633,7 @@ private: return Type; switch (CurrentToken->Tok.getIdentifierInfo()->getPPKeywordID()) { case tok::pp_include: + case tok::pp_include_next: case tok::pp_import: next(); parseIncludeDirective(); diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 9c3448ad83..d035043b0f 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -5987,6 +5987,7 @@ TEST_F(FormatTest, HandlesIncludeDirectives) { "#include \"string.h\"\n" "#include \n" "#include < path with space >\n" + "#include_next " "#include \"abc.h\" // this is included for ABC\n" "#include \"some long include\" // with a comment\n" "#include \"some very long include paaaaaaaaaaaaaaaaaaaaaaath\"",