[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Friends cannot be protected or private

Hi all,

I'm not on the list so please cc me any replies.

I've noticed that friends cannot be protected or private anymore with
g++-3.4 and g++-4.0. Is this the correct behaviour? Why?

adamm@mira:/tmp$ g++ -c test.cpp
test.cpp:4: error: ‘void test1::f1()’ is protected
test.cpp:9: error: within this context

adamm@mira:/tmp$ cat test.cpp

class test1
void f1();

class test2
friend void test1::f1();

- Adam

Reply to: