mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 421823 - When a base class lookup runs into a deferred instance,
disambiguate between a method and a field Change-Id: I03cf9aa55d79c6b9f2a96bf3cace36e706bfecfb Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
a9a454f256
commit
6ed25565a6
3 changed files with 25 additions and 1 deletions
|
@ -8816,4 +8816,22 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
public void testAmbiguityResolutionOrder_462348b() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename>
|
||||
// struct Base {
|
||||
// template <typename>
|
||||
// void method(int);
|
||||
// };
|
||||
//
|
||||
// template <typename V>
|
||||
// struct C : Base<V> {
|
||||
// typedef int WALDO;
|
||||
//
|
||||
// C() {
|
||||
// this->template method<WALDO>(0);
|
||||
// }
|
||||
// };
|
||||
public void testRegression_421823() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,6 +217,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPScope;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateNonTypeArgument;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPTemplateParameterMap;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownConstructor;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownField;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownMemberClass;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownMethod;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUsingDeclaration;
|
||||
|
@ -497,8 +498,10 @@ public class CPPSemantics {
|
|||
if (binding == null && data.skippedScope != null) {
|
||||
if (namePropertyInParent == IASTNamedTypeSpecifier.NAME) {
|
||||
binding= new CPPUnknownMemberClass(data.skippedScope, name.getSimpleID());
|
||||
} else {
|
||||
} else if (data.isFunctionCall()) {
|
||||
binding= new CPPUnknownMethod(data.skippedScope, name.getSimpleID());
|
||||
} else {
|
||||
binding= new CPPUnknownField(data.skippedScope, name.getSimpleID());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -186,6 +186,9 @@ public class LookupData extends ScopeLookupData {
|
|||
fDeclarator= (IASTDeclarator) nameParent;
|
||||
} else if (nameParent instanceof IASTFieldReference) {
|
||||
qualified= true;
|
||||
if (nameParent.getPropertyInParent() == IASTFunctionCallExpression.FUNCTION_NAME) {
|
||||
fFunctionCall= true;
|
||||
}
|
||||
} else if (nameParent instanceof IASTIdExpression) {
|
||||
if (nameParent.getPropertyInParent() == IASTFunctionCallExpression.FUNCTION_NAME) {
|
||||
fFunctionCall= true;
|
||||
|
|
Loading…
Add table
Reference in a new issue