mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
Bug 539535 - Originate an accurate lookup point in CPPASTFieldReference.createEvaluation()
Change-Id: I8030d5b304a61d7235a8ca92cf99de2d9a9aff68
This commit is contained in:
parent
cf99170296
commit
d3b1d7652d
2 changed files with 54 additions and 33 deletions
|
@ -292,6 +292,8 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation createEvaluation() {
|
private ICPPEvaluation createEvaluation() {
|
||||||
|
try {
|
||||||
|
CPPSemantics.pushLookupPoint(this);
|
||||||
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
||||||
if (!ownerEval.isTypeDependent()) {
|
if (!ownerEval.isTypeDependent()) {
|
||||||
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getType(), fIsDeref, null, false);
|
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getType(), fIsDeref, null, false);
|
||||||
|
@ -329,6 +331,9 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new EvalID(ownerEval, qualifier, fName.getSimpleID(), false, true, fIsDeref, args, this);
|
return new EvalID(ownerEval, qualifier, fName.getSimpleID(), false, true, fIsDeref, args, this);
|
||||||
|
} finally {
|
||||||
|
CPPSemantics.popLookupPoint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getFieldPosition(ICPPField field) {
|
public static int getFieldPosition(ICPPField field) {
|
||||||
|
|
|
@ -740,4 +740,20 @@ public class SemanticHighlightingTest extends TestCase {
|
||||||
ignoredHighlightings.add(SemanticHighlightings.OVERLOADED_OPERATOR);
|
ignoredHighlightings.add(SemanticHighlightings.OVERLOADED_OPERATOR);
|
||||||
makeAssertions(ignoredHighlightings);
|
makeAssertions(ignoredHighlightings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// struct S { //$class
|
||||||
|
// int waldo; //$field
|
||||||
|
// };
|
||||||
|
// struct Iter { //$class
|
||||||
|
// S operator*(); //$class,methodDeclaration
|
||||||
|
// };
|
||||||
|
// int main() { //$functionDeclaration
|
||||||
|
// Iter it; //$class,localVariableDeclaration
|
||||||
|
// // TODO: The fact that the opening parenthesis gets its own overloadedOperator
|
||||||
|
// // semantic highlighting is an (unrelated) bug.
|
||||||
|
// 1 + (*it).waldo; //$overloadedOperator,overloadedOperator,localVariable,field
|
||||||
|
// }
|
||||||
|
public void testOverloadedOperatorStar_539535() throws Exception {
|
||||||
|
makeAssertions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue