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

--- Comment #2 from Joshua Maiche <joshua.maiche at gmail dot com> ---
I thought the inconsistency was just tied to whether the default template
parameter was a dependent name, but even within cases where a private dependent
type is used, there seems to be some inconsistency on whether the private type
is considered "off limit" or not:

```
template <typename T>
class Private
{
private:
    class Internal;
    template <typename>
    friend class Accessor;
};

template <typename T>
class Accessor
{
public:
    template <typename = typename Private<T>::Internal>
    static constexpr int val = 0;

    template <typename = typename Private<T>::Internal>
    static int GetVal() { return 0; };
};

class Dummy {};

int main()
{
    int val;
    val = Accessor<Dummy>::val<>; // Fails to compile.
    val = Accessor<Dummy>::GetVal<>(); // Succeeds.
    return val;
}
```

For comparison, Clang and MSVC compile all parts of this code successfully.

Reply via email to