Class can't access its own private static constexpr method - Clang bug? : <p>This code does not compile in Clang (6,7,8,9,trunk), but compiles just fine in GCC (7.1, 8.1, 9.1):</p>

<pre class="lang-cpp prettyprint-override"><code>template&lt;class T&gt; struct TypeHolder { using type = T; };

template&lt;int i&gt;
class Outer {
private:
    template&lt;class T&gt; 
    static constexpr auto compute_type() {
        if constexpr (i == 42) {
            return TypeHolder&lt;bool&gt;{};
        } else {
            return TypeHolder&lt;T&gt;{};
        }
    }

public:
    template&lt;class T&gt;
    using TheType = typename decltype(Outer&lt;i&gt;::compute_type&lt;T&gt;())::type;
};

int main() {
    Outer&lt;42&gt;::TheType&lt;int&gt; i;
}
</code></pre>

<p>Clang tells me:</p>

<pre><code>&lt;source&gt;:17:49: error: 'compute_type' is a private member of 'Outer&lt;42&gt;'
</code></pre>

<p>… which of course it is, but I'm trying to access that member from <em>inside</em> the same class. I don't see why it should not be accessible there. Have I hit (and should I file) a Clang bug?</p>

<p>You can toy around with the code at <a href="https://gcc.godbolt.org/z/9NxRTU" rel="noreferrer">Godbolt's compiler explorer</a>.</p>
