https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105344

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jan Polasek from comment #0) 
> https://godbolt.org/z/ozf1MbG3n shows this code works fine under MSVC.

You don't try to use foo afterwards.
Once you do, MSVC will have an ICE.
try:
```
#include <source_location>
#include <utility>

template <int i, class = void> struct foo;

// Two following two specializations are different, yet gcc errors out,
// claiming they are the same.
#line 9
template <int i>
struct foo<i, std::enable_if_t<i == std::source_location::current().line()>> {
    static constexpr int num = i;
};

#line 14
template <int i>
struct foo<i, std::enable_if_t<i == std::source_location::current().line()>> {
    static constexpr int num = i;
};


int main(void)
{
    foo<9> t;
    foo<14> t;
}
```

So I don't know if this is valid or not.

Reply via email to