<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/145628>145628</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] [Modules] Avoid duplicated checkings
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

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

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

<pre>
    Reproducer:

```
// RUN: rm -fr %t
// RUN: mkdir %t
// RUN: split-file %s %t
// RUN: mkdir %t/tmp
//
// RUN: %clang -std=c++20 -x c++-module %t/a.cpp --precompile -o %t/a.pcm
//
// RUN: %check_clang_tidy -std=c++20 -check-suffix=DEFAULT %t/a.cpp \
// RUN:   cppcoreguidelines-narrowing-conversions %t/a.cpp -- \
// RUN:   -config='{}'

// RUN: clang-tidy %t/use.cpp -fix --checks=-*,cppcoreguidelines-narrowing-conversions \
// RUN: -config={} -- \
// RUN:     -fmodule-file=a=%t/a.pcm -std=c++20 -nostdinc++

//--- a.cpp
export module a;
export void most_narrowing_is_not_ok() {
  int i;
  long long ui;
  i = ui;
  // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
}

//--- use.cpp
import a;
void use() {
    most_narrowing_is_not_ok();
    // CHECK-MESSAGES-DEFAULT:
}
```

In this example, we don't hope we see the warning for use.cpp. Concretely, we can save a lot of times avoid duplicated checkings.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVU2P4jgQ_TXFpWTkdgiBQw6BwO5oZ-YwvSPtDRnHCd5O7Kzt0PS_X9mkgemP6ZYiiF2uqvdeVcXcOdVoKXNIV5CWEz74g7H5-jBw_Z_6Z1hO9qZ6yn_I3ppqENJCUgCNz5yODy2AbYFt8cfP75AUaDsktUV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