<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVk1v4zYQ_TX2hYjgSHayPvjgOLttgG1TNIveKYmS2KVIgaTs-N_3DUn5I2tgFyig2DFFzpt582aGpamPmxddqbEWO-5Fa6wUjknNOu8HNyu2s_wLnkpx3WZK7fvM2BYLtakcvna0_sXYnvs3f1TidfDSaJd1vldMvA-KS-2Y77hnszz_1gnWczIueC0sa4xlnDkz2kqwRirB-OgNbMmKK3VkrfCOVdGtI1vAQjZbPM8WWzLUSOs8G6wpleiZTCjSs4ZLhV-GwcexFzosGg17FVyTAHZATS7AJnmELyYb2thxx0ohNDgIrNTsIH3HZg8Ej88LD5yAwRrQbhQ3HZjwznBhy88gGCdb4tK3eDxhTx4AEo82HvYnHohSOvv16z9_0OK_ovIAq_joBPmWIHES1JrDlAr3MUoWzPf8O7Y6oZ2Y5btg2Hmua25r0gj23q-ygr1dZDAAOIiA3Hb86JLPsByf-HP19KfxAvpiW-U7M7Yd4yCkHxAEUsZJRoA_Ugx7cIgQe1F1XEsXg4RrUreM21J6yyGPCxkhv3vkgIMRpCEiBkKLHf4-IyBuq44iQhCt0MJyRUCt5X1PZDh4pGpGnF2eA24En0hLzqUE0tbrCAAR0cHZlNLwd7IUvUYqRk9SCZsgG2-NYqa5YTK7ySfZv67YtqqyVo-pXCF_qUUq2moY8Jmq_u7tCMvvsWIpX7FQkfw9t5JT9Tgior4IPJEM_45wP8gosXcu0fj5NHo2apz0o0Ydq-Mko90sf8LDdsYK9tuI0MlBRx6E96PjrSAECrHYUVUA_lwiKUMk_lKcCo0UcegEDFgIfJY_hmh-mVvKjAk94RfiZCViuwXsu6kUAroVCsb3pMQIGXinA7QpCuLTde6kM8hR1kJUY5lJQ412GIiqM1O314q_3R0ASF6zfH2Vii2c7XtUle8IPPRHuHhTTs5WsB82ZqSWsJhaB170RyXL04Zu2vDBCBA6vo-0TwVTi0bqAI_FYSyVrNj2rxdU5MAtBAKVWdMzQ0S6jG0hawdcwU5QU8u7pjU5SlS-IC5k8tGH5e-kmSwjycgEL0Lv4vp46mUkSqog9MdDkBUkNbYYGNh04NDs-qeyhYBEmnMnwSaNkjGqH0IIc_SuCQPzPCecEFHaReKY_chwDMB_mKBBxin4q2y_asEOVEuwblTIAo6fouN1UCBargkTO-wbRCWbWH61tBgcNHUHC87eYwRlfJnGSsZeGvaC-axD1cLD1FKep8OvB_17TDw1-hgT4oANfc1EFfw6jcsfop8m4mXo1HJR2XRJ8BQLTjfBy9CLg4I-WEkEzetNUa-LNZ_jttEZu7Girg_cNg_r-WjV5kMfjUWI2sEPugClr7vEQihXXACoIFfF4r6Yd5vHdQFjTbkq83xVLPOC82XzqcyLh0Ysy0Uzx2gSym0wBVH_WhziHYJa2-p5_v89kJt8keeL-8Xq_nG1WCyz5oEv71c1f8yLxYMo17PlQoBLdbrRze0mmCzH1uGlks6780vunGy1EMFheOilV2KzVcocLtrZzSvL-V4RayL89xmf8-DzJjj8H94mhq8>53013</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Allow including the "main" header with `<` `>`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          reddwarf69
      </td>
    </tr>
</table>

<pre>
    IncludeCategories in https://clang.llvm.org/docs/ClangFormatStyleOptions.html explains that "The main header for a source file automatically gets category 0".
The first problem is that it fails to document it only considers a header "main" if it has been included with `"`.
The second issue is that it fails to consider a header that has been included with `"` as the "main" header.

This is not a problem for the LLVM project because it includes its own headers with `"`. This makes sense, the standard in "15.3 Source file inclusion" says
```
[Note: Although an implementation may provide a mechanism for making arbitrary source files available to
the < > search, in general programmers should use the < > form for headers provided with the implementation,
and the " " form for sources outside the control of the implementation.
```
and https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html says "This variant is used for header files of your own program".

But unfortunately, the C++ Core Guidelines say the usage of `<` or `"` should not be considering whether it's "outside the control of the implementation" or "header files of your own program" but considering whether the file is "relative to the including file" (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-incform).

A common thing to do is
```
src/thing.cpp
include/mylib/thing.hpp
```
to have the headers defining the public API separated from others. And since thing.hpp is not relative to thing.cpp (I don't think `..` is defined in any standard, and it would be ugly anyway), the C++ Core Guidelines state that `<` should be used and clang-format fails to see `#include mylib/thing.hpp` is the main header of thing.cpp.

One way to solve this would be adding an option to specify the directory prefix used by the project. If I can say `IncludeDirectoryOwnHeaders: mylib` then clang-format could consider mylib/thing.hpp as the main header without getting confused with otherlib/thing.hpp.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVk2P2zYQ_TX2hVhBluPd-OCD4yTtAmlTdIveKWkksaFIgaTW8b_vG4ryx8ZAAsiyTZHzZt68mVFp69Pu2VR6rOkgA7XWKfJCGdGFMPjFer8oPuOqtDRtpvVrn1nXYqG2lcfXgdc_W9fL8BJOmr4OQVnjsy70WtD3QUtlvAidDGJRFP90JHrJxknW5ERjnZDC29FVJBqlScgxWNhSldT6JFoKXlSTWyeRw0K2yD8u8j0bapTzQQzOlpp6oRKKCqKRSuOfFfBx7MnERWtgr4JrCsAeqMkF2GSP8CVUwxs76UVJZMBBZKUWRxU6sXhkeNyvPPAEgzWg_Uh3HZjxLnBxy88ghGRbdO3bdDxhzx4AEpexAfZnHphSPvvly79_8OJ_VAWAVXL0xL4lSJwEtfY4p8K_jVJE8738hq2ejKdFcYiGfZCmlq5mjWDvapOtxctVBiOAhwjYbS9PPvkMy9M1_d18-NMGgr7EXofOjm0nJAjpBwSBlEmWEeBPHMMrOESIPVWdNMpPQcI1ZVohXamCk5DHlYyQ31fkQIIRpGFCjISuD_h8QkDSVR1HhCBaMuSkZqDWyb5nMjw80rVgzq7PAXcCn0lLzqUE8tbbCAAxoYOzOaXxc7Y0eY1UjIGlEjdBNsFZLWxzx2R2l0-2f1ux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