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:
parent
796991a0e4
commit
6fc37b10e7
2 changed files with 14 additions and 3 deletions
|
@ -426,4 +426,12 @@ public class SemanticHighlightingTest extends TestCase {
|
||||||
public void testCStructureName_451772() throws Exception {
|
public void testCStructureName_451772() throws Exception {
|
||||||
makeAssertions(false /* parse as C file */);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,13 +486,16 @@ public class SemanticHighlightings {
|
||||||
if (binding instanceof ICPPMethod) {
|
if (binding instanceof ICPPMethod) {
|
||||||
return true;
|
return true;
|
||||||
} else if (binding instanceof ICPPDeferredFunction) {
|
} 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) {
|
if (candidate instanceof ICPPMethod) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue