https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69410
Bug ID: 69410
Summary: friend declarations in local classes
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
void a();
void f() {
class A {
friend void ::a();
friend class Z;
};
}
---
The above fails for two (false) reasons, although it shouldn't. a is qualified,
therefore [class.friend]/11 does not apply. However, [class.friend]/11 does
apply in the subsequent declaration, making it well-formed - Z is declared to
be a local class. See the example in the aforementioned paragraph.