Source:
private static ICPPTemplateArgument convertNonTypeTemplateArgument(ICPPTemplateDefinition template, final IType paramType, ICPPTemplateArgument arg) throws DOMException { IType a= arg.getTypeOfNonTypeValue(); if (a instanceof ICPPParameterPackType) { a = ((ICPPParameterPackType) a).getType(); } IType p; if (paramType instanceof IFunctionType) { p = new CPPPointerType(paramType); } else if (paramType instanceof IArrayType) { p = new CPPPointerType(((IArrayType) paramType).getType()); } else { p= paramType; if (p != null && p.isSameType(a)) return arg; } if (a instanceof FunctionSetType) { if (p instanceof IPointerType) { p= ((IPointerType) p).getType(); } if (p instanceof IFunctionType) { final CPPFunctionSet functionSet = ((FunctionSetType) a).getFunctionSet(); for (ICPPFunction f : functionSet.getBindings()) { if (p.isSameType(f.getType())) { functionSet.applySelectedFunction(f); return new CPPTemplateNonTypeArgument(new EvalBinding(f, null, template)); } } } return null; } if (paramType instanceof ProblemType) { if (((ProblemType) paramType).getID() == ProblemType.TYPE_CANNOT_DEDUCE_AUTO_TYPE) { return new CPPTemplateNonTypeArgument(arg.getNonTypeValue(), arg.getTypeOfNonTypeValue()); } } Cost cost = Conversions.checkImplicitConversionSequence(p, a, LVALUE, UDCMode.FORBIDDEN, Context.ORDINARY); if (cost == null || !cost.converts()) { ICPPEvaluation eval = arg.getNonTypeEvaluation(); ICPPEvaluation newEval = CPPEvaluation.maybeApplyConversion(eval, p, false); if (newEval == EvalFixed.INCOMPLETE && newEval != eval) return null; return new CPPTemplateNonTypeArgument(newEval); } return new CPPTemplateNonTypeArgument(arg.getNonTypeValue(), paramType); }

Target:
private static ICPPTemplateArgument convertNonTypeTemplateArgument(ICPPTemplateDefinition template, final IType paramType, ICPPTemplateArgument arg) throws DOMException { IType a= arg.getTypeOfNonTypeValue(); if (a instanceof ICPPParameterPackType) { a = ((ICPPParameterPackType) a).getType(); } IType p; if (paramType instanceof IFunctionType) { p = new CPPPointerType(paramType); } else if (paramType instanceof IArrayType) { p = new CPPPointerType(((IArrayType) paramType).getType()); } else { p= paramType; if (p != null && p.isSameType(a)) return arg; } if (a instanceof FunctionSetType) { if (p instanceof IPointerType) { p= ((IPointerType) p).getType(); } if (p instanceof IFunctionType) { final CPPFunctionSet functionSet = ((FunctionSetType) a).getFunctionSet(); for (ICPPFunction f : functionSet.getBindings()) { if (p.isSameType(f.getType())) { functionSet.applySelectedFunction(f); return new CPPTemplateNonTypeArgument(new EvalBinding(f, null, template)); } } } return null; } if (paramType instanceof ProblemType) { if (((ProblemType) paramType).getID() == ProblemType.TYPE_CANNOT_DEDUCE_AUTO_TYPE) { return arg; } } Cost cost = Conversions.checkImplicitConversionSequence(p, a, LVALUE, UDCMode.FORBIDDEN, Context.ORDINARY); if (cost == null || !cost.converts()) { ICPPEvaluation eval = arg.getNonTypeEvaluation(); ICPPEvaluation newEval = CPPEvaluation.maybeApplyConversion(eval, p, false); if (newEval == EvalFixed.INCOMPLETE && newEval != eval) return null; return new CPPTemplateNonTypeArgument(newEval); } return new CPPTemplateNonTypeArgument(arg.getNonTypeValue(), paramType); }