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 - friend in template
Summary: friend in template
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-10 13:03 UTC by soldatov
Modified: 2016-10-31 10:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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