mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
Bug 459047 - [AccessContext] namingClass not found for nested class
specializations if a binding is a member of a ClassInstance (owner) we should not try to find a corresponding class template (target). Change-Id: Ic865161f137ecb2a300afd03761cc26ee758b38b Signed-off-by: Michi <woskimi@yahoo.de>
This commit is contained in:
parent
9ca379e67f
commit
3cf9300566
2 changed files with 18 additions and 3 deletions
|
@ -301,12 +301,12 @@ public class AccessContext {
|
|||
}
|
||||
if (maxdepth > 0) {
|
||||
for (ICPPBase cppBase : ClassTypeHelper.getBases(derived, point)) {
|
||||
IBinding base= cppBase.getBaseClass();
|
||||
if (base instanceof ICPPSpecialization) {
|
||||
IBinding base = cppBase.getBaseClass();
|
||||
if (!(target instanceof ICPPSpecialization) && base instanceof ICPPSpecialization) {
|
||||
base = ((ICPPSpecialization) base).getSpecializedBinding();
|
||||
}
|
||||
if (base instanceof ICPPClassType) {
|
||||
ICPPClassType tbase= (ICPPClassType) base;
|
||||
ICPPClassType tbase = (ICPPClassType) base;
|
||||
if (tbase.isSameType(target)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1474,6 +1474,21 @@ public class CompletionTests extends AbstractContentAssistTest {
|
|||
assertContentAssistResults(fCursorOffset, expected, true, DISPLAY);
|
||||
}
|
||||
|
||||
// struct Wrapper {
|
||||
// template<typename T>
|
||||
// struct A {
|
||||
// static void test();
|
||||
// };
|
||||
//
|
||||
// struct B : A<B> {
|
||||
// void run(){ te/*cursor*/ }
|
||||
// };
|
||||
// };
|
||||
public void testTemplateInstanceMemberAccess_459047() throws Exception {
|
||||
final String[] expected = { "test(void)" };
|
||||
assertContentAssistResults(fCursorOffset, expected, true, ID);
|
||||
}
|
||||
|
||||
// void foo() { Specialization<int, /*cursor*/
|
||||
public void testTemplateArgumentList() throws Exception {
|
||||
setCommaAfterFunctionParameter(CCorePlugin.INSERT);
|
||||
|
|
Loading…
Add table
Reference in a new issue