[Bug c++/36163] New: Friend declaration confused by namespace/using
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Tue May 6 21:30:00 GMT 2008
This code:
namespace name {
class foo {
public:
template<class T>
void baz(T& t) { int i = t.dat; }
};
}
using namespace name;
class bar {
friend class foo;
int dat;
};
int main() {
bar b;
foo f;
f.baz(b);
}
gets you:
~/ootbc/members$ g++ foo.cc
foo.cc: In member function 'void name::foo::baz(T&) [with T = bar]':
foo.cc:16: instantiated from here
foo.cc:11: error: 'int bar::dat' is private
foo.cc:5: error: within this context
--
Summary: Friend declaration confused by namespace/using
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36163
More information about the Gcc-bugs
mailing list