[PATCH] D65022: [Sema] Always instantiate the initializer of a variable template with undeduced type (8.0 regression)

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 11:17:35 PDT 2019


erik.pilkington added a comment.

Hmm, looks like this patch fails to fix the case where we're referencing the variable in an non-odr use context, since we don't even bother to instantiate the initializer here:

  template <class T>
  struct S {
    template <class T2>
    static constexpr auto x = 43;
  };
  
  int main() {
    sizeof(S<int>::x<char>);
  }

I think we should instantiate the initializer before forming a referencing expression and marking it used. @rsmith: do you mind if I just land https://reviews.llvm.org/D65022?id=210905 and file a bug to fix the regression we're seeing here?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65022/new/

https://reviews.llvm.org/D65022





More information about the cfe-commits mailing list