C++ global extern “C” friend can't reach private member on namespaced class

前端 未结 3 2421
轻奢々
轻奢々 2021-02-20 14:46

Please consider the code:

#include    

using namespace std;

extern  \"C\"
void    foo( void );

namespace   A
{
    template< int No >
           


        
3条回答
  •  野的像风
    2021-02-20 14:50

    It's a g++ bug. Exists in 4.4, fixed in 4.6.

    UPD: It seems that it's triggered by a combination of template and namespace. extern "C" is not relevant, as it may be commented out and the error remains.

提交回复
热议问题