mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Bug 459389 - [code assist] no members for deeply nested class templates
Change-Id: Ia6b3461325a9c489d10dd1356d46e7e6b6ee61f0 Signed-off-by: Michi <woskimi@yahoo.de>
This commit is contained in:
parent
23938e2b3d
commit
8a896c57ed
2 changed files with 32 additions and 5 deletions
|
@ -180,9 +180,16 @@ public class AccessContext {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
accessLevel = getMemberAccessLevel(derivedClass, accessLevel);
|
accessLevel = getMemberAccessLevel(derivedClass, accessLevel);
|
||||||
if (owner.isSameType(derivedClass) ||
|
|
||||||
(derivedClass instanceof ICPPClassSpecialization &&
|
if (!(owner instanceof ICPPSpecialization)) {
|
||||||
owner.equals(((ICPPClassSpecialization) derivedClass).getSpecializedBinding()))) {
|
while (derivedClass instanceof ICPPSpecialization) {
|
||||||
|
IBinding specialized = ((ICPPSpecialization) derivedClass).getSpecializedBinding();
|
||||||
|
if (specialized instanceof ICPPClassType) {
|
||||||
|
derivedClass = (ICPPClassType) specialized;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (owner.isSameType(derivedClass)) {
|
||||||
return isAccessible(bindingVisibility, accessLevel);
|
return isAccessible(bindingVisibility, accessLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,8 +309,10 @@ public class AccessContext {
|
||||||
if (maxdepth > 0) {
|
if (maxdepth > 0) {
|
||||||
for (ICPPBase cppBase : ClassTypeHelper.getBases(derived, point)) {
|
for (ICPPBase cppBase : ClassTypeHelper.getBases(derived, point)) {
|
||||||
IBinding base = cppBase.getBaseClass();
|
IBinding base = cppBase.getBaseClass();
|
||||||
if (!(target instanceof ICPPSpecialization) && base instanceof ICPPSpecialization) {
|
if (!(target instanceof ICPPSpecialization)) {
|
||||||
base = ((ICPPSpecialization) base).getSpecializedBinding();
|
while (base instanceof ICPPSpecialization) {
|
||||||
|
base = ((ICPPSpecialization) base).getSpecializedBinding();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (base instanceof ICPPClassType) {
|
if (base instanceof ICPPClassType) {
|
||||||
ICPPClassType tbase = (ICPPClassType) base;
|
ICPPClassType tbase = (ICPPClassType) base;
|
||||||
|
|
|
@ -772,6 +772,24 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
assertCompletionResults(fCursorOffset, expected, ID);
|
assertCompletionResults(fCursorOffset, expected, ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename T>
|
||||||
|
// struct A {
|
||||||
|
// template <typename U>
|
||||||
|
// struct AA {
|
||||||
|
// template <typename V>
|
||||||
|
// struct AAA {
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// struct B : A<B> {
|
||||||
|
// AA<B>::/*cursor*/
|
||||||
|
// };
|
||||||
|
public void testMemebersForDeeplyNestedTemplates_459389() throws Exception {
|
||||||
|
final String[] expected = { "AAA<typename V>" };
|
||||||
|
assertCompletionResults(fCursorOffset, expected, DISPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
// struct A {};
|
// struct A {};
|
||||||
//
|
//
|
||||||
// template<typename T>
|
// template<typename T>
|
||||||
|
|
Loading…
Add table
Reference in a new issue