aaron.ballman added a comment.

Hmm, the test case you added passes without the patch applied: 
https://godbolt.org/z/T9TerMYGz

I think the issue is that the class needs to be an instantiated template type: 
https://godbolt.org/z/bhznPdsvf, and a second (interesting but contrived) test 
case would be:

  template <typename>
  struct Friendly {
    template <typename T>
    friend void generic_friend() {}
  };
  
  template <typename T>
  void generic_friend();
  
  int main() {
    Friendly<int> f;
    generic_friend<int>();
  }

(We do NOT want to diagnose the second declaration of generic_friend as being 
redundant -- it is necessary to make the definition visible.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114299

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

Reply via email to