tbaeder added a comment.

Hmm, this doesn't work if the callee is somewhere in between the path from the 
dynamic to the static type, e.g.

  struct A {
    virtual constexpr int foo() const { return 1; }
  };
  
  struct B : A {
    virtual constexpr int foo() const { return A::foo(); }
  };
  
  constexpr B a;
  static_assert(a.foo() == 1);

For the `A::foo()` call, the type of the `This` pointer is `B`, so we will just 
select the `B::foo()` to call.


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

https://reviews.llvm.org/D142630

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

Reply via email to