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.

View | Details | Raw Unified | Return to bug 214111
Collapse All | Expand All

(-)a/cnd.completion/test/unit/data/org/netbeans/modules/cnd/completion/cplusplus/hyperlink/Cpp11TestCase/bug214111.cpp (+50 lines)
Line 0 Link Here
1
class MyQString
2
{
3
public:
4
    MyQString &append(char* c);
5
};
6
7
template <typename T>
8
class MyQList
9
{
10
public:
11
12
    struct MyNode { void *v;
13
        T &t()
14
        { return v ; }
15
    };
16
    
17
    class const_iterator;
18
19
    class const_iterator {
20
    public:
21
        MyNode *i;
22
        
23
        inline const_iterator() : i(0) {}
24
        inline const_iterator(MyNode *n) : i(n) {}
25
        inline const_iterator(const const_iterator &o): i(o.i) {}
26
27
        inline const T &operator*() const { return i->t(); }
28
        inline const T *operator->() const { return &i->t(); }
29
30
        inline const_iterator &operator++() { ++i; return *this; }
31
        inline const_iterator operator++(int) { MyNode *n = i; ++i; return n; }
32
    };
33
    friend class const_iterator;
34
35
    // stl style
36
    inline const_iterator constBegin() const {}
37
    inline const_iterator constEnd() const {}
38
39
};
40
41
class MyQStringList : public MyQList<MyQString>
42
{
43
};
44
45
void bug214111_foo() {
46
    const MyQStringList& lobuf;
47
    for (auto&& Loit = lobuf.constBegin();Loit != lobuf.constEnd();Loit++) {
48
             Loit->append("a");
49
    } 
50
}
(-)a/cnd.completion/test/unit/src/org/netbeans/modules/cnd/completion/cplusplus/hyperlink/Cpp11TestCase.java (+5 lines)
Lines 137-141 Link Here
137
        // Bug 210303 - Unresolved instantiation
137
        // Bug 210303 - Unresolved instantiation
138
        performTest("bug210303.cpp", 18, 11, "bug210303.cpp", 11, 9);
138
        performTest("bug210303.cpp", 18, 11, "bug210303.cpp", 11, 9);
139
    }
139
    }
140
141
    public void testBug214111() throws Exception {
142
        // Bug 214111 - No code completion for auto variable
143
        performTest("bug214111.cpp", 48, 23, "bug214111.cpp", 4, 5);
144
    }
140
    
145
    
141
}
146
}
(-)a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/Instantiation.java (+14 lines)
Lines 1418-1423 Link Here
1418
                        return resolved;
1418
                        return resolved;
1419
                    }
1419
                    }
1420
                }
1420
                }
1421
                if (CsmKindUtilities.isClass(resolved) && CsmKindUtilities.isClassMember(resolved)) {
1422
                    CsmMember tdMember = (CsmMember)resolved;
1423
                    if (CsmKindUtilities.isTemplate(tdMember.getContainingClass())) {
1424
                        resolved = new Class((CsmClass)resolved, instantiation.getMapping());
1425
                        return resolved;
1426
                    }
1427
                }
1421
            }
1428
            }
1422
            return resolved;
1429
            return resolved;
1423
        }
1430
        }
Lines 1587-1592 Link Here
1587
                        return resolved;
1594
                        return resolved;
1588
                    }
1595
                    }
1589
                }
1596
                }
1597
                if (CsmKindUtilities.isClass(resolved) && CsmKindUtilities.isClassMember(resolved)) {
1598
                    CsmMember tdMember = (CsmMember)resolved;
1599
                    if (CsmKindUtilities.isTemplate(tdMember.getContainingClass())) {
1600
                        resolved = new Class((CsmClass)resolved, instantiation.getMapping());
1601
                        return resolved;
1602
                    }
1603
                }                
1590
            }
1604
            }
1591
            return resolved;
1605
            return resolved;
1592
        }
1606
        }

Return to bug 214111