private IType getReturnType() { ICPPASTFunctionDeclarator lambdaDtor = fLambdaExpression.getDeclarator(); if (lambdaDtor != null) { IASTTypeId trailingReturnType = lambdaDtor.getTrailingReturnType(); if (trailingReturnType != null) { return CPPVisitor.createType(trailingReturnType); } } IASTCompoundStatement body = fLambdaExpression.getBody(); if (body != null) { IASTStatement[] stmts = body.getStatements(); if (stmts.length > 0) { // Gnu extension allows to deduce return type in complex compound statements IASTStatement stmt = stmts[stmts.length - 1]; if (stmt instanceof IASTReturnStatement) { IASTReturnStatement rtstmt = (IASTReturnStatement) stmt; IASTExpression expr = rtstmt.getReturnValue(); if (expr != null) { IType type = expr.getExpressionType(); type = Conversions.lvalue_to_rvalue(type, false); if (type != null) { return type; } } } } } return CPPSemantics.VOID_TYPE; }
private IType[] getParameterTypes() { ICPPASTFunctionDeclarator lambdaDtor = fLambdaExpression.getDeclarator(); if (lambdaDtor != null) { return CPPVisitor.createParameterTypes(lambdaDtor); } return IType.EMPTY_TYPE_ARRAY; }
private boolean isMutable() { ICPPASTFunctionDeclarator lambdaDtor = fLambdaExpression.getDeclarator(); return lambdaDtor != null && lambdaDtor.isMutable(); }