<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add ability to pass extra flags to clangd"
   href="https://bugs.llvm.org/show_bug.cgi?id=41924">41924</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Add ability to pass extra flags to clangd
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang-tools-extra
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>clangd
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tdhutt@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have a CMake project which produces a compile_commands.json file. I'm using
it with the clangd VSCode extension. I'm thinking about moving to that from Qt
Creator. However one thing Qt Creator does a lot better is that you can specify
the warning flags for its code model and have them distinct from the actual
CMake compilation flags.

For example in CMake I basically have `-Wall -Wextra -Werror`. But in Qt
Creator I have `-Weverything` which is great when editing files because I get
nice inline warnings about stuff I might not have thought about.

I obviously don't want to enabled `-Weverything -Werror` in my actual build, so
is there a way to have Clangd use different diagnostic flags to the actual
build.

Solutions I have discounted:

* Add `compile_flags.txt` containing `-Wno-error -Weverything`. I haven't
actually tried this but looking at the source code it looks like you can't use
`compile_flags.txt` *and* `compiled_commands.json`.

* Run `compile_commands.json` through a script that modifies it. I really don't
want to do this because then clangd can't monitor it for changes (I'm not sure
that actually happens in practice but it *should* happen).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>