This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 223600

Summary: friend in template
Product: cnd Reporter: soldatov <soldatov>
Component: Code ModelAssignee: petrk
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description soldatov 2012-12-10 13:03:06 UTC
#include <iostream>

template<class T>
class A {
private:

    void ma() {
        std::cout << "ok" << std::endl;
    }
    friend void T::mb();
};

class B {
private:
    A<B>* p_;
public:
    B(A<B>* p) : p_(p) {}
    void mb() {
        p_->ma(); // invalid identifier
    }
};

int main(int argc, char *argv[]) {
    A<B> a;
    B b(&a);
    b.mb();
    return 0;
}
Comment 1 Vladimir Voskresensky 2014-11-20 11:06:46 UTC
confirmed