1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-09 19:43:27 +02:00

Bug 511653 - Completion of inheriting constructor in using-declaration

Change-Id: If20d85bd6199e8f08152f3a5801bfb30b61d1d09
This commit is contained in:
Nathan Ridge 2017-02-05 02:13:47 -05:00
parent c0ba7f6bfb
commit 2e1f2d475a
2 changed files with 12 additions and 1 deletions

View file

@ -314,8 +314,9 @@ public class CPPASTQualifiedName extends CPPASTNameBase
ICPPClassType classQualifier = getClassQualifier(); ICPPClassType classQualifier = getClassQualifier();
if (classQualifier != null) { if (classQualifier != null) {
final boolean isDeclaration = getParent().getParent() instanceof IASTSimpleDeclaration; final boolean isDeclaration = getParent().getParent() instanceof IASTSimpleDeclaration;
final boolean isUsingDecl = getParent() instanceof ICPPASTUsingDeclaration;
List<IBinding> filtered = filterClassScopeBindings(classQualifier, bindings, isDeclaration); List<IBinding> filtered = filterClassScopeBindings(classQualifier, bindings, isDeclaration);
if (isDeclaration && nameMatches(classQualifier.getNameCharArray(), if ((isDeclaration || isUsingDecl) && nameMatches(classQualifier.getNameCharArray(),
n.getLookupKey(), isPrefix)) { n.getLookupKey(), isPrefix)) {
ICPPConstructor[] constructors = ClassTypeHelper.getConstructors(classQualifier, n); ICPPConstructor[] constructors = ClassTypeHelper.getConstructors(classQualifier, n);
for (int i = 0; i < constructors.length; i++) { for (int i = 0; i < constructors.length; i++) {

View file

@ -1868,4 +1868,14 @@ public class CompletionTests extends CompletionTestBase {
public void testExistingParens_72391() throws Exception { public void testExistingParens_72391() throws Exception {
assertCompletionResults(new String[] { "waldo" }); // expect no parens in replacement assertCompletionResults(new String[] { "waldo" }); // expect no parens in replacement
} }
// struct A{
// A(int,int);
// };
// struct B: A{
// using A::/*cursor*/
// };
public void testInheritingConstructor_511653() throws Exception {
assertCompletionResults(new String[] { "A;" });
}
} }