ahatanak added a comment.

OK, I'll add the test.

When I apply this patch and compile your test, I see DependentScopeDeclRefExpr 
gets converted to DeclRefExpr when the function is instantiated. This doesn't 
happen without this patch, but somehow clang still manages to emit the same 
code.

Also, Erik Pilkington pointed out that clang still crashes when it compiles the 
following code. I'm trying to figure out why that happens.

  // Template variable case:
  enum class foo { a, b };
  template <class T> auto a = [](foo f = foo::a) { return f; }();
  
  auto foo1() {
    return a<int>;
  }
  
  // Template struct case:
  template <class T> struct func {
    void bar() {
      enum class foo { a, b };
      [](foo f = foo::a) { return f; }();
    }
  };
  
  template struct func<int>;


https://reviews.llvm.org/D23096



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to