[cfe-dev] Problem with clang-tidy not finding all issues when additional header is included

Andrew McDonald via cfe-dev cfe-dev at lists.llvm.org
Mon May 4 05:32:31 PDT 2020


Hello, is this the right place to ask about clang-tidy problems? Please
direct me somewhere else if appropriate. In a nutshell, I've got a
situation where clang-tidy on Mac OS Catalina (installed by compiling LLVM
10.0.0 through Homebrew) will correctly find issues in a source file; but
when a standard library header is included, it stops finding them all.

A trivial example reproduces the issue:
-----
// #include <vector>
typedef int MyInt;
typedef float MyFloat;
-----

Running "clang-tidy main.cpp -checks=-*,modernize-use-using" with the
include commented out:
-----
2 warnings generated.
/Users/andrew.mcdonald/Desktop/Test/main.cpp:2:1: warning: use 'using'
instead of 'typedef' [modernize-use-using]
typedef int MyInt;
^~~~~~~~~~~~~~~~~
using MyInt = int
/Users/andrew.mcdonald/Desktop/Test/main.cpp:3:1: warning: use 'using'
instead of 'typedef' [modernize-use-using]
typedef float MyFloat;
^~~~~~~~~~~~~~~~~~~~~
using MyFloat = float
-----

With the include enabled, it only reports one of them:
-----
1044 warnings generated.
/Users/andrew.mcdonald/Desktop/Test/main.cpp:3:1: warning: use 'using'
instead of 'typedef' [modernize-use-using]
typedef float MyFloat;
^~~~~~~~~~~~~~~~~~~~~
using MyFloat = float
Suppressed 1043 warnings (1043 in non-user code).
-----

It seems to work fine through Godbolt, so I'm wondering if there's a
specific installation issue. Are there any verbose or debugging flags that
would help to show what's going wrong?
Thanks for any help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200504/5624ed49/attachment.html>


More information about the cfe-dev mailing list