<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 - fix-it in clang"
   href="https://bugs.llvm.org/show_bug.cgi?id=43816">43816</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fix-it in clang
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm@alex.lanin.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

clang-tidy can not only be used to improve code, but also to make it work in
the first place.

Taking an example from
<a href="https://github.com/llvm-mirror/clang/blob/master/test/SemaTemplate/dependent-template-recover.cpp">https://github.com/llvm-mirror/clang/blob/master/test/SemaTemplate/dependent-template-recover.cpp</a>

    template<typename T, typename U, int N>
    struct X {
      void f(T* t) {
        t->f0<U>(); // expected-error{{use 'template' keyword to treat 'f0' as
a dependent template name}}
      }
    };

Clang-tidy is capable of fixing that error.
However it’s not possible to fix it without running any other checks?!
e.g. this works fine: clang-tidy --checks="*" test.cpp -fix-errors but it
performs all sorts of other changes.

The best approach seems to be to pick some checker that doesn’t find anything
in order to fix only errors ?!


Clang itself emits the same warning and suggestion, but there is no way to
fix-it from there. See <a href="https://godbolt.org/z/iXXy4o">https://godbolt.org/z/iXXy4o</a>

According to <a href="http://lists.llvm.org/pipermail/cfe-dev/2019-October/063703.html">http://lists.llvm.org/pipermail/cfe-dev/2019-October/063703.html</a>
I'm hereby trying to file the idea here to have either some clang -fix option
or clang-tidy running without mandatory checkers.</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>