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

    <tr>
        <th>Summary</th>
        <td>
            Clang-tidy invalid suggestion: misc-use-internal-linkage
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          joker-eph
      </td>
    </tr>
</table>

<pre>
    With clang-tidy built at current head and applying it on MLIR:

```
$ clang-tidy -p build mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp --checks=-*,misc-use-internal-linkage -fix -fix-errors



```
diff --git a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
index 1787e0a44f8f..50a93dec9446 100644
--- a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
+++ b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
@@ -485,8 +485,8 @@ struct RoundOpPattern final : public OpConversionPattern<math::RoundOp> {
 //===----------------------------------------------------------------------===//
 
 namespace mlir {
-void populateMathToSPIRVPatterns(const SPIRVTypeConverter &typeConverter,
- RewritePatternSet &patterns) {
+static void populateMathToSPIRVPatterns(const SPIRVTypeConverter &typeConverter,
+ RewritePatternSet &patterns) {
   // Core patterns
   patterns
       .add<CopySignPattern,
```


Yields a build failure:


```
>>> referenced by MathToSPIRVPass.cpp
>>> MathToSPIRVPass.cpp.o:((anonymous namespace)::ConvertMathToSPIRVPass::runOnOperation()) in archive lib/libMLIRMathToSPIRV.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```


</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVVGPmzgQ_jXOy8iRYwMhDzywaSNVumqr3epO92jsCbhrbGSbdPPvTxCaZNs76dQWjRLAnm8-ZsbfyBhN6xArkj-Q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