-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
accepts-invalidbugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
| Bugzilla Link | 40233 |
| Version | trunk |
| OS | Linux |
| CC | @DougGregor,@zygoloid |
Extended Description
Based on this stackoverflow question: https://stackoverflow.com/q/54055638/1013719
gcc correctly rejects the following, while clang accepts:
class Cls {
friend void func(int) { }
friend void ::func(int);
};with:
error: ‘void func(int)’ has not been declared within ‘::’
friend void ::func(int);
^~
note: only here as a ‘friend’
friend void func(int) { }
^~~~
The friend definition should not make func visible by http://eel.is/c++draft/namespace.memdef#3.sentence-2
The friend declaration does not by itself make the name visible to unqualified lookup or qualified lookup.
Metadata
Metadata
Assignees
Labels
accepts-invalidbugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"