https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88725
Bug ID: 88725
Summary: fails to deduce template specialization in friend
declaration
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: haining.cpp at gmail dot com
Target Milestone: ---
gcc fails to deduce that the friend declaration refers to ::func<int> in the
below
```
template <typename T>
void func(T);
class Cls {
friend void ::func(int);
};
```
Rejecting with
```
error: 'void func(int)' should have been declared inside '::'
friend void ::func(int);
^
```
I believe this should be allowed by [temp.friend]/1.3:
http://eel.is/c++draft/temp.friend#1.3
see discussion here: https://stackoverflow.com/q/54055575/1013719