hfinkel added a comment.

In D71241#1782723 <https://reviews.llvm.org/D71241#1782723>, @ABataev wrote:

> I don't insist on function redefinition solution. You want to replace 
> functions - fine, but do this at the codegen, not in AST.


Again, no one is replacing anything, and we're not mutating the AST. We're 
simply resolving the callee according to the language rules. That's something 
that should be done during AST construction.

It's like if I have this code:

  template <int x>
  int foo() { return 0; }
  
  template <>
  int foo<8>() { return 1; }
  
  int main() {
    return foo<8>();
  }

and you said that, in the AST, it should look like the unspecialized `foo` was 
being called. And then later, in CodeGen, something happened in order to cause 
the correct specialization would be called. That clearly would not be 
considered an acceptable design.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71241



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

Reply via email to