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

--- Comment #3 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
This slightly modified program:
```
template<typename T>
class Foo;

template<typename T>
int g(const Foo<T>&);

template<typename T>
class Foo {
public:
    template<typename U>
    int g(const Foo<U>&) = delete;
    friend int g<>(const Foo<T>&);
private:
    int m = 1;
};

template<typename T>
int g(const Foo<T>& f) { return f.m; }

int main() {
    return g(Foo<int>{});
}
```
is accepted by both Clang and MSVC (but not EDG and GCC). Online demo:
https://gcc.godbolt.org/z/M3cWEc679

Reply via email to