ojhunt wrote:
I was trying to understand what that same type was doing vs qualifiers and
found this weirdness with partial specialization:
https://compiler-explorer.com/z/cnvG13EvW
Basically when not doing partial specialization we don't match `const int*` to
`int*`, but with partial specialization we do. Rejecting the match in both
cases seems like it should be correct, but gcc accepts in both cases.
This PR doesn't introduce the behavior, but if it is fixing other issues around
matching maybe it should fix this as well?
```cpp
int bar;
template <auto> struct Foo{
static constexpr int wibble = 0;
};
template <> struct Foo<&bar>{
static constexpr int wibble = 1;
};
template <class, auto> struct Bar {
static constexpr int wibble = 0;
};
template <class T> struct Bar<T, &bar> {
static constexpr int wibble = 1;
};
static_assert(Foo<&bar>::wibble == 1);
static_assert(Bar<void, &bar>::wibble == 1);
static_assert(Foo<(const int*)&bar>::wibble == 0);
static_assert(Bar<void, (const int*)&bar>::wibble == 0);
```
https://github.com/llvm/llvm-project/pull/225239
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits