<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 24, 2015 at 1:24 PM, Michael Park <span dir="ltr"><<a href="mailto:mcypark@gmail.com" target="_blank">mcypark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>This patch instantiates the pending local instantiations earlier in order to enable to following code to compile:<br></div><div><pre style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">  template <typename T>
  void F() {
    struct Num {
      static constexpr int Get() { return 42; }
    };
    constexpr int n = Num::Get();
  }

  int main() {
    F<int>();
  }</pre>This addresses PR20625.</div></div>
</blockquote></div><br></div><div class="gmail_extra">Hmm. This approach still rejects this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">template<typename T> void f() {</div><div class="gmail_extra">  struct X {</div><div class="gmail_extra">    static constexpr int get() { return 42; }</div><div class="gmail_extra">    int arr[get()];</div><div class="gmail_extra">  };</div><div class="gmail_extra">}</div><div class="gmail_extra">template void f<int>();<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm OK with that; we reject the corresponding non-template case, but accept the corresponding non-local class template case.</div><div class="gmail_extra"><br></div><div class="gmail_extra">LGTM</div></div>