1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 18:55:38 +02:00

Added getOverload method.

This commit is contained in:
Sergey Prigogin 2012-02-22 10:46:58 -08:00
parent dc6bc55815
commit 948494892a
2 changed files with 22 additions and 11 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others. * Copyright (c) 2004, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
* Contributors: * Contributors:
* John Camelon (IBM) - Initial API and implementation * John Camelon (IBM) - Initial API and implementation
* Mike Kucera * Mike Kucera
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp; package org.eclipse.cdt.core.dom.ast.cpp;
@ -19,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPASTUnaryExpression extends IASTUnaryExpression, IASTImplicitNameOwner { public interface ICPPASTUnaryExpression extends IASTUnaryExpression, IASTImplicitNameOwner {
/** /**
* <code>op_throw</code> throw exp * <code>op_throw</code> throw exp
*/ */
@ -47,4 +47,11 @@ public interface ICPPASTUnaryExpression extends IASTUnaryExpression, IASTImplici
*/ */
@Override @Override
public ICPPASTUnaryExpression copy(CopyStyle style); public ICPPASTUnaryExpression copy(CopyStyle style);
/**
* Returns the function binding for the overloaded operator, or <code>null</code> if
* the operator is not overloaded.
* @since 5.4
*/
public ICPPFunction getOverload();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others. * Copyright (c) 2004, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying masterials * All rights reserved. This program and the accompanying masterials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -15,7 +15,10 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE; import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.*; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.glvalueType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.prvalueType;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.typeFromFunctionCall;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.ExpressionTypes.valueCategoryFromFunctionCall;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateTypeUptoPointers; import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getUltimateTypeUptoPointers;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
@ -177,6 +180,7 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
} }
} }
@Override
public ICPPFunction getOverload() { public ICPPFunction getOverload() {
if (overload != UNINITIALIZED_FUNCTION) if (overload != UNINITIALIZED_FUNCTION)
return overload; return overload;