1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-05 08:05:24 +02:00

Bug 458317 - Fix an NPE in MethodHighlighting.consumes()

Change-Id: I6a88e26aa60d57dd8c95079672ce0c1ceff8b3d7
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
Nathan Ridge 2015-01-24 05:23:26 -05:00 committed by Sergey Prigogin
parent 796991a0e4
commit 6fc37b10e7
2 changed files with 14 additions and 3 deletions

View file

@ -426,4 +426,12 @@ public class SemanticHighlightingTest extends TestCase {
public void testCStructureName_451772() throws Exception {
makeAssertions(false /* parse as C file */);
}
// template <typename T> //$templateParameter
// void foo(T t) { //$functionDeclaration,templateParameter,parameterVariable
// bar(t); //$function,parameterVariable
// }
public void testNPE_458317() throws Exception {
makeAssertions();
}
}

View file

@ -486,13 +486,16 @@ public class SemanticHighlightings {
if (binding instanceof ICPPMethod) {
return true;
} else if (binding instanceof ICPPDeferredFunction) {
for (ICPPFunction candidate : ((ICPPDeferredFunction) binding).getCandidates()) {
ICPPFunction[] candidates = ((ICPPDeferredFunction) binding).getCandidates();
if (candidates != null) {
for (ICPPFunction candidate : candidates) {
if (candidate instanceof ICPPMethod) {
return true;
}
}
}
}
}
return false;
}
}