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

Fixed an NPE.

This commit is contained in:
Sergey Prigogin 2013-08-29 17:17:02 -07:00
parent c9ab9203e6
commit 3edcac7cc7

View file

@ -310,13 +310,15 @@ public class BindingClassifier {
ICPPTemplateParameterMap parameterMap = ((ICPPSpecialization) binding).getTemplateParameterMap(); ICPPTemplateParameterMap parameterMap = ((ICPPSpecialization) binding).getTemplateParameterMap();
for (Integer position : parameterMap.getAllParameterPositions()) { for (Integer position : parameterMap.getAllParameterPositions()) {
ICPPTemplateArgument argument = parameterMap.getArgument(position); ICPPTemplateArgument argument = parameterMap.getArgument(position);
IType type = argument.getTypeValue(); if (argument != null) {
// Normally we don't need to define parameters of a template specialization that IType type = argument.getTypeValue();
// were not specified explicitly. __gnu_cxx::hash is an exception from that rule. // Normally we don't need to define parameters of a template specialization that
if (type instanceof IBinding && "hash".equals(((IBinding) type).getName())) { //$NON-NLS-1$ // were not specified explicitly. __gnu_cxx::hash is an exception from that rule.
IBinding owner = ((IBinding) type).getOwner(); if (type instanceof IBinding && "hash".equals(((IBinding) type).getName())) { //$NON-NLS-1$
if (owner instanceof ICPPNamespace && "__gnu_cxx".equals(owner.getName())) //$NON-NLS-1$ IBinding owner = ((IBinding) type).getOwner();
bindings.add((IBinding) type); if (owner instanceof ICPPNamespace && "__gnu_cxx".equals(owner.getName())) //$NON-NLS-1$
bindings.add((IBinding) type);
}
} }
} }
// Get the specialized binding - e.g. get the binding for X if the current binding is // Get the specialized binding - e.g. get the binding for X if the current binding is