https://bugs.llvm.org/show_bug.cgi?id=40238

            Bug ID: 40238
           Summary: fails to deduce template specialization in friend
                    declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

clang 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: out-of-line declaration of 'func' does not match any declaration in the
global namespace
    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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to