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

    <tr>
        <th>Summary</th>
        <td>
            Clang incorrectly rejects getting address of conditionally noexcept function in a nested class template
        </td>
    </tr>

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

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

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

<pre>
    Accepted by VS 2022 17.10 Preview 1, GCC 13.2, rejected by Clang 17.0.6.

```cpp
template <bool NE>
struct Foo {
  template <class D>
  static void Fun() noexcept(NE) {}
};

int main() {
  using F = decltype(&Foo<true>::Fun<int>);
  F f{&Foo<true>::Fun<int>};
}
```

Output from `clang-cl /EHsc /nologo /W4 /std:c++latest /c test.cpp`:

```txt
test.cpp:9:8: error: address of overloaded function 'Fun' does not match required type 'void () noexcept'
    9 |   F f{&Foo<true>::Fun<int>};
      | ^~~~~~~~~~~~~~~~~~~
test.cpp:4:15: note: candidate template ignored: could not match 'void ()' against 'void () noexcept'
    4 |   static void Fun() noexcept(NE) {}
      |               ^
1 error generated.
```

Output from `clang-cl -v`:

```txt
clang version 17.0.6
Target: x86_64-pc-windows-msvc
Thread model: posix
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2P8yYQ_jXkMoplg2M7Bx_y5fb0tlKr9lgRmDhUBFzA2eTS316N87F5u5W2WmQZNMzAPM8zjIzR9A6xZYs1W2xnckxHH9qTcf3lTc72Xl_blVI4JNSwv8JvvwDPOYeizoocfg54NvgGBeMb-GGzgUJknNYB_0R1D9lY6XoKyLMqY_mW5av7v8pvnxqGmyXhabAyITCx2Xtv4duOid1tL6YwqgSd98Dq9c0G8BqhrIwRts8IgJhkMgrO3mjoRsd4w_gSnMcLIWK8-bYjA51Xb-9J1Vsm1q9pGpfgJM0j-uXyMRrXQwdMbEGjsuk64ORVdd4zsUlhRMpGrJhY0f1iY1wiC18-LwHo4ECHfh71mtoz3weJryn_NKZhTHAI_gTELykwVxYY73Y_RkWz89b3nla_l_SPSTOxUoyvGV8TozGRWQGtMlKoyiml_9IvXdJDv7uvWC2ZWDVMrABD8IEWUuuAMYI_gD9jsF5q1HAYnUrGO2C8niSqQXuM4DyxntQRAv41moAaiF5ym-T8oGX9oBOARNrA14iFaVA8W-z-_jA-4CyZWBULwud8QpqVdNpoqslncZre-YB62vWj1S_ovsdD8GUvjZvY_xxpeUf6hUJ_B_r9YIv78ylu0kGPDoNMqLMvVNz8_H_qZnKHM4ZIlXBrFbedX2XoMRFxl6b6oyrng5q_Gaf9W5yf4lndvY4BpYaT12jJd_DRXP512Uy3Qi_FUs6wLeq8yRdFwfns2Na4bPKDUnl9KCVvZLM8iDKXjZZSlbLRM9PynJc5L6qci6bkmaqrZol5LYqqLsu6ZmWOJ2lsZu35lPnQz0yMI7ZNsaz4zMo92jg1WM4npIxz6rWhJf_5fuwjK3NrYorvJySTLLa33mmc8iGgSvZ676wRekyJus_Lq1LeaUNvSVp7fYr__sKMAwkOI_XlW698FOhsDLY9pjREkop3jHe9Scdxnyl_YryjrO7TfAieMmC8m0BGxrsJ5z8BAAD__6I_1is">