Open
Description
Accepted by VS 2022 17.10 Preview 1, GCC 13.2, rejected by Clang 17.0.6.
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
:
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
:
clang version 17.0.6
Target: x86_64-pc-windows-msvc
Thread model: posix