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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] `[[clang::noinline]]` is ignored on operators in template functions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    The code below produces a warning that `[[clang::noinline]]` is ignored because there is no function call, even though there is no way Clang can know that (and there can indeed be a function call). It also doesn't annotate the emitted LLVM IR.
```c++
template <class T>
void test(T s) {
 [[clang::noinline]] s + 2;
}
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUkFv2zwM_TX0hWhgU3acHHxomi9AgX6XodhdlhhbqyIFFp2g_36Q625YL8MAAoZNvsf3zKdTckNg7qA5QHMs9CxjnLrr6Hxwb23bFn20793ryGiiZezZxztep2hnwwk13vUUXBhQRi0I23LhORivwwDqEdRjiC54FxiaY65tiS6hG0Kc2GLPRs-JUUaeODdCxPMcjLgY0GjvgZ6QbxxQxjgP4x-Dd_2OT3kRGh3wLcT7qoJ2Oth1NLdcsLwsQ_2Vfb_BZ0HtU0QbOQWgVlCHEEXLIgv54kTY4svL9__x-dsGyiOUj9npUgbokGv5Kny5-gwE9WS8TglfQf330btFZ1E4CdDuFRPQHqFdcfiXv4YJgQ5IoFYAtMcvOj5eC9spu1d7XXBXtVS327ohKsZOn1VZqp2penU2tK_Ppm1s3yvW5bnve1W4jkqqyx21laqaarcxba2tbpgq4kaZGuqSL9r5jfe3yyZOQ-FSmrmryi1Vu8Lrnn1aYkT0aeQ8xSAcLBDlcE1dxj7085CgLr1Lkn6ziRO_xHA5aTb9z2mKAeOVJy1xSugC_jrH59FTMU--G0WuKdPRCeg0OBnnfmPiBeiU1ayPh-sUf7ARoNNiNAGdVq-3jn4GAAD___xpAJk">