mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 316308 - [C++0x] Explicit conversion operators
This commit is contained in:
parent
6be0d2175e
commit
9505f9ea9e
46 changed files with 265 additions and 185 deletions
|
@ -8895,5 +8895,24 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
IFunction f= bh.assertNonProblem("constBegin(); //ref", 10);
|
IFunction f= bh.assertNonProblem("constBegin(); //ref", 10);
|
||||||
bh.assertProblem("begin(); //ref", 5);
|
bh.assertProblem("begin(); //ref", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <class T> class PE {
|
||||||
|
// explicit operator bool() const;
|
||||||
|
// };
|
||||||
|
// template <class T> class P {
|
||||||
|
// operator bool() const;
|
||||||
|
// };
|
||||||
|
// void fint(int);
|
||||||
|
// void test() {
|
||||||
|
// PE<int> pe;
|
||||||
|
// P<int> p;
|
||||||
|
// fint(pe + pe); // problem
|
||||||
|
// fint(p + p); // converted to boolean and then int.
|
||||||
|
// };
|
||||||
|
public void testExplicitConversionOperators() throws Exception {
|
||||||
|
String code= getAboveComment();
|
||||||
|
BindingAssertionHelper bh= new BindingAssertionHelper(code, true);
|
||||||
|
bh.assertProblem("fint(pe + pe);", 4);
|
||||||
|
bh.assertNonProblem("fint(p + p);", 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,10 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTProblem;
|
||||||
*
|
*
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
|
* @deprecated The class is provided for testing purposes, only. It should not be used by clients.
|
||||||
|
* Within CDT it is recommended to use {@link ASTSignatureUtil}, instead.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class ASTSignatureUtil {
|
public class ASTSignatureUtil {
|
||||||
|
|
||||||
private static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
private static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
||||||
|
|
|
@ -17,9 +17,4 @@ package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
*/
|
*/
|
||||||
public interface ICPPConstructor extends ICPPMethod {
|
public interface ICPPConstructor extends ICPPMethod {
|
||||||
public static final ICPPConstructor [] EMPTY_CONSTRUCTOR_ARRAY = new ICPPConstructor[0];
|
public static final ICPPConstructor [] EMPTY_CONSTRUCTOR_ARRAY = new ICPPConstructor[0];
|
||||||
/**
|
|
||||||
* Whether or not this constructor was declared as explicit
|
|
||||||
*/
|
|
||||||
boolean isExplicit();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,12 @@ public interface ICPPMethod extends ICPPFunction, ICPPMember {
|
||||||
*/
|
*/
|
||||||
public boolean isImplicit();
|
public boolean isImplicit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this is an explicit constructor or an explicit conversion operator.
|
||||||
|
* @since 5.3
|
||||||
|
*/
|
||||||
|
boolean isExplicit();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this is a pure abstract method
|
* Returns whether this is a pure abstract method
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
|
|
|
@ -326,6 +326,9 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
|
||||||
public boolean isImplicit() {
|
public boolean isImplicit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public boolean hasDefaultValue() {
|
public boolean hasDefaultValue() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
import org.eclipse.cdt.internal.core.model.ASTStringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base for all c++ declaration specifiers
|
* Base for all c++ declaration specifiers
|
||||||
|
@ -113,8 +113,11 @@ public abstract class CPPASTBaseDeclSpecifier extends ASTNode implements ICPPAST
|
||||||
other.setOffsetAndLength(this);
|
other.setOffsetAndLength(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
|
* Provided for debugging purposes, only.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return ASTSignatureUtil.getSignature(this);
|
return ASTStringUtil.getSignatureString(this, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
|
@ -24,30 +22,10 @@ public class CPPConstructor extends CPPMethod implements ICPPConstructor {
|
||||||
public CPPConstructorProblem(ICPPClassType owner, IASTNode node, int id, char[] arg) {
|
public CPPConstructorProblem(ICPPClassType owner, IASTNode node, int id, char[] arg) {
|
||||||
super(owner, node, id, arg);
|
super(owner, node, id, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param declarator
|
|
||||||
*/
|
|
||||||
public CPPConstructor(ICPPASTFunctionDeclarator declarator) {
|
public CPPConstructor(ICPPASTFunctionDeclarator declarator) {
|
||||||
super(declarator);
|
super(declarator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
|
|
||||||
*/
|
|
||||||
public boolean isExplicit() {
|
|
||||||
IASTDeclaration decl= getPrimaryDeclaration();
|
|
||||||
if (decl != null) {
|
|
||||||
ICPPASTDeclSpecifier declspec= getDeclSpec(decl);
|
|
||||||
if (declspec != null) {
|
|
||||||
return declspec.isExplicit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,4 @@ public class CPPConstructorInstance extends CPPMethodInstance implements ICPPCon
|
||||||
CPPTemplateParameterMap tpmap, ICPPTemplateArgument[] args) {
|
CPPTemplateParameterMap tpmap, ICPPTemplateArgument[] args) {
|
||||||
super(orig, owner, tpmap, args);
|
super(orig, owner, tpmap, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor) getTemplateDefinition()).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,4 @@ public class CPPConstructorSpecialization extends CPPMethodSpecialization
|
||||||
ICPPTemplateParameterMap argMap) {
|
ICPPTemplateParameterMap argMap) {
|
||||||
super(orig, owner, argMap);
|
super(orig, owner, argMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
|
|
||||||
*/
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,4 @@ public class CPPConstructorTemplate extends CPPMethodTemplate implements ICPPCon
|
||||||
public CPPConstructorTemplate(IASTName name) {
|
public CPPConstructorTemplate(IASTName name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
|
|
||||||
*/
|
|
||||||
public boolean isExplicit() {
|
|
||||||
// mstodo fix that
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,4 @@ public class CPPConstructorTemplateSpecialization extends CPPMethodTemplateSpeci
|
||||||
ICPPClassType owner, ICPPTemplateParameterMap tpmap) {
|
ICPPClassType owner, ICPPTemplateParameterMap tpmap) {
|
||||||
super(original, owner, tpmap);
|
super(original, owner, tpmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
|
|
||||||
*/
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
|
@ -178,15 +179,10 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
|
||||||
do {
|
do {
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
IASTNode parent = name.getParent();
|
IASTNode parent = name.getParent();
|
||||||
while(!(parent instanceof IASTDeclaration))
|
while (parent != null && !(parent instanceof IASTDeclaration))
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
||||||
IASTDeclSpecifier declSpec = null;
|
IASTDeclSpecifier declSpec = getDeclSpecifier((IASTDeclaration) parent);
|
||||||
if (parent instanceof IASTSimpleDeclaration) {
|
|
||||||
declSpec = ((IASTSimpleDeclaration)parent).getDeclSpecifier();
|
|
||||||
} else if (parent instanceof IASTFunctionDefinition) {
|
|
||||||
declSpec = ((IASTFunctionDefinition)parent).getDeclSpecifier();
|
|
||||||
}
|
|
||||||
if (declSpec != null && declSpec.getStorageClass() == storage) {
|
if (declSpec != null && declSpec.getStorageClass() == storage) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -199,6 +195,16 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected ICPPASTDeclSpecifier getDeclSpecifier(IASTDeclaration decl) {
|
||||||
|
if (decl instanceof IASTSimpleDeclaration) {
|
||||||
|
return (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration)decl).getDeclSpecifier();
|
||||||
|
}
|
||||||
|
if (decl instanceof IASTFunctionDefinition) {
|
||||||
|
return (ICPPASTDeclSpecifier) ((IASTFunctionDefinition)decl).getDeclSpecifier();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public IBinding resolveParameter(CPPParameter param) {
|
public IBinding resolveParameter(CPPParameter param) {
|
||||||
int pos= param.getParameterPosition();
|
int pos= param.getParameterPosition();
|
||||||
|
|
||||||
|
@ -282,15 +288,10 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
|
||||||
do {
|
do {
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
IASTNode parent = name.getParent();
|
IASTNode parent = name.getParent();
|
||||||
while(!(parent instanceof IASTDeclaration))
|
while (parent != null && !(parent instanceof IASTDeclaration))
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
|
||||||
IASTDeclSpecifier declSpec = null;
|
IASTDeclSpecifier declSpec = getDeclSpecifier((IASTDeclaration) parent);
|
||||||
if (parent instanceof IASTSimpleDeclaration) {
|
|
||||||
declSpec = ((IASTSimpleDeclaration)parent).getDeclSpecifier();
|
|
||||||
} else if (parent instanceof IASTFunctionDefinition) {
|
|
||||||
declSpec = ((IASTFunctionDefinition)parent).getDeclSpecifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (declSpec != null && declSpec.isInline())
|
if (declSpec != null && declSpec.isInline())
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2009 IBM Corporation and others.
|
* Copyright (c) 2004, 2010 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
|
||||||
|
@ -11,9 +11,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
||||||
import org.eclipse.cdt.core.dom.ast.IParameter;
|
import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
|
@ -33,8 +33,4 @@ public class CPPImplicitConstructor extends CPPImplicitMethod implements ICPPCon
|
||||||
IType returnType= new CPPBasicType(Kind.eUnspecified, 0);
|
IType returnType= new CPPBasicType(Kind.eUnspecified, 0);
|
||||||
return CPPVisitor.createImplicitFunctionType(returnType, params, false, false);
|
return CPPVisitor.createImplicitFunctionType(returnType, params, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,10 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
|
||||||
return getPrimaryDeclaration() == null;
|
return getPrimaryDeclaration() == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isPureVirtual() {
|
public boolean isPureVirtual() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,4 +246,14 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
IASTDeclaration decl= getPrimaryDeclaration();
|
||||||
|
if (decl != null) {
|
||||||
|
ICPPASTDeclSpecifier declspec= getDeclSpec(decl);
|
||||||
|
if (declspec != null) {
|
||||||
|
return declspec.isExplicit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,10 @@ public class CPPMethodInstance extends CPPFunctionInstance implements ICPPMethod
|
||||||
public boolean isPureVirtual() {
|
public boolean isPureVirtual() {
|
||||||
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
|
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod) getTemplateDefinition()).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isDestructor()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isDestructor()
|
||||||
|
|
|
@ -73,6 +73,10 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)getSpecializedBinding()).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isImplicit() {
|
public boolean isImplicit() {
|
||||||
return ((ICPPMethod) getSpecializedBinding()).isImplicit();
|
return ((ICPPMethod) getSpecializedBinding()).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
||||||
|
@ -139,18 +141,25 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
// TODO Auto-generated method stub
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
return false;
|
if (decl instanceof ICPPASTTemplateDeclaration) {
|
||||||
}
|
ICPPASTDeclSpecifier declSpec= getDeclSpecifier(((ICPPASTTemplateDeclaration) decl).getDeclaration());
|
||||||
|
if (declSpec != null) {
|
||||||
|
return declSpec.isVirtual();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInline() {
|
public boolean isInline() {
|
||||||
IASTDeclaration decl = getPrimaryDeclaration();
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
if( decl instanceof ICPPASTTemplateDeclaration && ((ICPPASTTemplateDeclaration)decl).getDeclaration() instanceof IASTFunctionDefinition )
|
if (decl instanceof ICPPASTTemplateDeclaration
|
||||||
return true;
|
&& ((ICPPASTTemplateDeclaration) decl).getDeclaration() instanceof IASTFunctionDefinition)
|
||||||
|
return true;
|
||||||
|
|
||||||
return super.isInline();
|
return super.isInline();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDestructor() {
|
public boolean isDestructor() {
|
||||||
char[] name = getNameCharArray();
|
char[] name = getNameCharArray();
|
||||||
|
@ -163,9 +172,34 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
|
||||||
public boolean isImplicit() {
|
public boolean isImplicit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPureVirtual() {
|
public boolean isExplicit() {
|
||||||
|
IASTDeclaration decl = getPrimaryDeclaration();
|
||||||
|
if (decl instanceof ICPPASTTemplateDeclaration) {
|
||||||
|
ICPPASTDeclSpecifier declSpec= getDeclSpecifier(((ICPPASTTemplateDeclaration) decl).getDeclaration());
|
||||||
|
if (declSpec != null) {
|
||||||
|
return declSpec.isExplicit();
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPureVirtual() {
|
||||||
|
if (declarations != null && declarations.length > 0) {
|
||||||
|
IASTName decl= declarations[0];
|
||||||
|
if (decl != null) {
|
||||||
|
IASTNode parent = decl.getParent();
|
||||||
|
while (!(parent instanceof IASTDeclarator) && parent != null)
|
||||||
|
parent = parent.getParent();
|
||||||
|
|
||||||
|
if (parent instanceof IASTDeclarator) {
|
||||||
|
IASTDeclarator dtor= ASTQueries.findTypeRelevantDeclarator((IASTDeclarator) parent);
|
||||||
|
if (dtor instanceof ICPPASTFunctionDeclarator) {
|
||||||
|
return ((ICPPASTFunctionDeclarator) dtor).isPureVirtual();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,14 +28,16 @@ public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpeciali
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
// TODO Auto-generated method stub
|
IBinding m = getSpecializedBinding();
|
||||||
|
if (m instanceof ICPPMethod)
|
||||||
|
return ((ICPPMethod) m).isVirtual();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVisibility() {
|
public int getVisibility() {
|
||||||
IBinding m = getSpecializedBinding();
|
IBinding m = getSpecializedBinding();
|
||||||
if( m instanceof ICPPMethod )
|
if (m instanceof ICPPMethod)
|
||||||
return ((ICPPMethod)m).getVisibility();
|
return ((ICPPMethod) m).getVisibility();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +54,23 @@ public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpeciali
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isImplicit() {
|
public boolean isImplicit() {
|
||||||
|
IBinding m = getSpecializedBinding();
|
||||||
|
if (m instanceof ICPPMethod)
|
||||||
|
return ((ICPPMethod) m).isImplicit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
IBinding m = getSpecializedBinding();
|
||||||
|
if (m instanceof ICPPMethod)
|
||||||
|
return ((ICPPMethod) m).isExplicit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPureVirtual() {
|
public boolean isPureVirtual() {
|
||||||
|
IBinding m = getSpecializedBinding();
|
||||||
|
if (m instanceof ICPPMethod)
|
||||||
|
return ((ICPPMethod) m).isPureVirtual();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
||||||
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPArithmeticConversion;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPArithmeticConversion;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBasicType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBuiltinParameter;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPBuiltinParameter;
|
||||||
|
@ -348,14 +349,11 @@ class BuiltinOperators {
|
||||||
IType t2= SemanticUtil.getNestedType(memPtr.getMemberOfClass(), TDEF);
|
IType t2= SemanticUtil.getNestedType(memPtr.getMemberOfClass(), TDEF);
|
||||||
if (t2 instanceof ICPPClassType) {
|
if (t2 instanceof ICPPClassType) {
|
||||||
ICPPClassType c2= (ICPPClassType) t2;
|
ICPPClassType c2= (ICPPClassType) t2;
|
||||||
try {
|
if (SemanticUtil.calculateInheritanceDepth(c1, c2) >= 0) {
|
||||||
if (SemanticUtil.calculateInheritanceDepth(c1, c2) >= 0) {
|
IType cvt= SemanticUtil.getNestedType(memPtr.getType(), TDEF);
|
||||||
IType cvt= SemanticUtil.getNestedType(memPtr.getType(), TDEF);
|
IType rt= new CPPReferenceType(
|
||||||
IType rt= new CPPReferenceType(
|
SemanticUtil.addQualifiers(cvt, cv1.isConst(), cv1.isVolatile()), false);
|
||||||
SemanticUtil.addQualifiers(cvt, cv1.isConst(), cv1.isVolatile()), false);
|
addFunction(rt, clsPtr, memPtr);
|
||||||
addFunction(rt, clsPtr, memPtr);
|
|
||||||
}
|
|
||||||
} catch (DOMException e) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,12 +644,19 @@ class BuiltinOperators {
|
||||||
try {
|
try {
|
||||||
ICPPMethod[] ops = SemanticUtil.getConversionOperators((ICPPClassType) type);
|
ICPPMethod[] ops = SemanticUtil.getConversionOperators((ICPPClassType) type);
|
||||||
result= new IType[ops.length];
|
result= new IType[ops.length];
|
||||||
for (int i = 0; i < result.length; i++) {
|
int j= -1;
|
||||||
final ICPPFunctionType functionType = ops[i].getType();
|
for (ICPPMethod op : ops) {
|
||||||
|
if (op.isExplicit())
|
||||||
|
continue;
|
||||||
|
final ICPPFunctionType functionType = op.getType();
|
||||||
if (functionType != null) {
|
if (functionType != null) {
|
||||||
result[i]= functionType.getReturnType();
|
IType retType= functionType.getReturnType();
|
||||||
|
if (retType != null) {
|
||||||
|
result[++j]= retType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result= ArrayUtil.trimAt(IType.class, result, j);
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2950,6 +2950,32 @@ public class CPPSemantics {
|
||||||
type = SemanticUtil.getNestedType(((ICPPVariable) binding).getType(), TDEF | CVTYPE);
|
type = SemanticUtil.getNestedType(((ICPPVariable) binding).getType(), TDEF | CVTYPE);
|
||||||
if (!(type instanceof ICPPClassType))
|
if (!(type instanceof ICPPClassType))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// Copy initialization
|
||||||
|
if (initializer instanceof IASTEqualsInitializer) {
|
||||||
|
IASTEqualsInitializer eqInit= (IASTEqualsInitializer) initializer;
|
||||||
|
IASTInitializerClause initClause = eqInit.getInitializerClause();
|
||||||
|
IType sourceType= null;
|
||||||
|
boolean isLValue= false;
|
||||||
|
if (initClause instanceof IASTExpression) {
|
||||||
|
final IASTExpression expr = (IASTExpression) initClause;
|
||||||
|
isLValue= expr.isLValue();
|
||||||
|
sourceType= SemanticUtil.getSimplifiedType(expr.getExpressionType());
|
||||||
|
} else if (initClause instanceof ICPPASTInitializerList) {
|
||||||
|
sourceType= new InitializerListType((ICPPASTInitializerList) initClause);
|
||||||
|
}
|
||||||
|
if (sourceType != null) {
|
||||||
|
Cost c= Conversions.checkUserDefinedConversionSequence(isLValue, sourceType, type, false, false);
|
||||||
|
if (c.converts()) {
|
||||||
|
IFunction f= c.getUserDefinedConversion();
|
||||||
|
if (f instanceof ICPPConstructor)
|
||||||
|
return (ICPPConstructor) f;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Direct Initialization
|
||||||
ICPPClassType classType = (ICPPClassType) type;
|
ICPPClassType classType = (ICPPClassType) type;
|
||||||
CPPASTName astName = new CPPASTName();
|
CPPASTName astName = new CPPASTName();
|
||||||
astName.setName(classType.getNameCharArray());
|
astName.setName(classType.getNameCharArray());
|
||||||
|
@ -2961,9 +2987,7 @@ public class CPPSemantics {
|
||||||
LookupData data = new LookupData(astName);
|
LookupData data = new LookupData(astName);
|
||||||
if (initializer == null) {
|
if (initializer == null) {
|
||||||
data.setFunctionArguments(IASTExpression.EMPTY_EXPRESSION_ARRAY);
|
data.setFunctionArguments(IASTExpression.EMPTY_EXPRESSION_ARRAY);
|
||||||
} else if (initializer instanceof IASTEqualsInitializer) {
|
} else if (initializer instanceof ICPPASTConstructorInitializer) {
|
||||||
data.setFunctionArguments(((IASTEqualsInitializer) initializer).getInitializerClause());
|
|
||||||
} else if (initializer instanceof ICPPASTConstructorInitializer) {
|
|
||||||
data.setFunctionArguments(((ICPPASTConstructorInitializer) initializer).getArguments());
|
data.setFunctionArguments(((ICPPASTConstructorInitializer) initializer).getArguments());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -3195,6 +3219,8 @@ public class CPPSemantics {
|
||||||
// 13.3.1.1.2 call to object of class type
|
// 13.3.1.1.2 call to object of class type
|
||||||
ICPPMethod[] ops = SemanticUtil.getConversionOperators(callToObjectOfClassType);
|
ICPPMethod[] ops = SemanticUtil.getConversionOperators(callToObjectOfClassType);
|
||||||
for (ICPPMethod op : ops) {
|
for (ICPPMethod op : ops) {
|
||||||
|
if (op.isExplicit())
|
||||||
|
continue;
|
||||||
IFunctionType ft= op.getType();
|
IFunctionType ft= op.getType();
|
||||||
if (ft != null) {
|
if (ft != null) {
|
||||||
IType rt= SemanticUtil.getNestedType(ft.getReturnType(), SemanticUtil.TDEF);
|
IType rt= SemanticUtil.getNestedType(ft.getReturnType(), SemanticUtil.TDEF);
|
||||||
|
|
|
@ -126,8 +126,8 @@ public class Conversions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ... or has a class type (i.e., T2 is a class type), where T1 is not reference-related to T2, and can be
|
// ... or has a class type (i.e., T2 is a class type), where T1 is not reference-related to T2, and can be
|
||||||
// implicitly converted to an lvalue of type �cv3 T3,� where �cv1 T1� is reference-compatible with
|
// implicitly converted to an lvalue of type 'cv3 T3', where 'cv1 T1' is reference-compatible with
|
||||||
// �cv3 T3� (this conversion is selected by enumerating the applicable conversion functions (13.3.1.6)
|
// 'cv3 T3' (this conversion is selected by enumerating the applicable conversion functions (13.3.1.6)
|
||||||
// and choosing the best one through overload resolution (13.3)),
|
// and choosing the best one through overload resolution (13.3)),
|
||||||
if (T2 instanceof ICPPClassType && udc != UDCMode.noUDC && isReferenceRelated(T1, T2) < 0) {
|
if (T2 instanceof ICPPClassType && udc != UDCMode.noUDC && isReferenceRelated(T1, T2) < 0) {
|
||||||
Cost cost= conversionFuncForDirectReference(cv1T1, cv2T2, T2, true);
|
Cost cost= conversionFuncForDirectReference(cv1T1, cv2T2, T2, true);
|
||||||
|
@ -340,7 +340,7 @@ public class Conversions {
|
||||||
return Cost.NO_CONVERSION;
|
return Cost.NO_CONVERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IType getInitListType(IType target) throws DOMException {
|
static IType getInitListType(IType target) {
|
||||||
if (target instanceof ICPPClassType && target instanceof ICPPTemplateInstance) {
|
if (target instanceof ICPPClassType && target instanceof ICPPTemplateInstance) {
|
||||||
ICPPTemplateInstance inst = (ICPPTemplateInstance) target;
|
ICPPTemplateInstance inst = (ICPPTemplateInstance) target;
|
||||||
if (CharArrayUtils.equals(INITIALIZER_LIST_NAME, inst.getNameCharArray())) {
|
if (CharArrayUtils.equals(INITIALIZER_LIST_NAME, inst.getNameCharArray())) {
|
||||||
|
@ -372,9 +372,8 @@ public class Conversions {
|
||||||
* <li>EQ 0 if cv1 == cv2
|
* <li>EQ 0 if cv1 == cv2
|
||||||
* <li>LT -1 if cv1 is less qualified than cv2 or not comparable
|
* <li>LT -1 if cv1 is less qualified than cv2 or not comparable
|
||||||
* </ul>
|
* </ul>
|
||||||
* @throws DOMException
|
|
||||||
*/
|
*/
|
||||||
private static final int compareQualifications(IType t1, IType t2) throws DOMException {
|
private static final int compareQualifications(IType t1, IType t2) {
|
||||||
CVQualifier cv1= getCVQualifier(t1);
|
CVQualifier cv1= getCVQualifier(t1);
|
||||||
CVQualifier cv2= getCVQualifier(t2);
|
CVQualifier cv2= getCVQualifier(t2);
|
||||||
|
|
||||||
|
@ -407,7 +406,7 @@ public class Conversions {
|
||||||
* Note this is not a symmetric relation.
|
* Note this is not a symmetric relation.
|
||||||
* @return inheritance distance, or -1, if <code>cv1t1</code> is not reference-related to <code>cv2t2</code>
|
* @return inheritance distance, or -1, if <code>cv1t1</code> is not reference-related to <code>cv2t2</code>
|
||||||
*/
|
*/
|
||||||
private static final int isReferenceRelated(IType cv1Target, IType cv2Source) throws DOMException {
|
private static final int isReferenceRelated(IType cv1Target, IType cv2Source) {
|
||||||
IType t= SemanticUtil.getNestedType(cv1Target, TDEF | REF);
|
IType t= SemanticUtil.getNestedType(cv1Target, TDEF | REF);
|
||||||
IType s= SemanticUtil.getNestedType(cv2Source, TDEF | REF);
|
IType s= SemanticUtil.getNestedType(cv2Source, TDEF | REF);
|
||||||
|
|
||||||
|
@ -458,7 +457,7 @@ public class Conversions {
|
||||||
* @return The cost for converting or <code>null</code> if <code>cv1t1</code> is not
|
* @return The cost for converting or <code>null</code> if <code>cv1t1</code> is not
|
||||||
* reference-compatible with <code>cv2t2</code>
|
* reference-compatible with <code>cv2t2</code>
|
||||||
*/
|
*/
|
||||||
private static final Cost isReferenceCompatible(IType cv1Target, IType cv2Source, boolean isImpliedObject) throws DOMException {
|
private static final Cost isReferenceCompatible(IType cv1Target, IType cv2Source, boolean isImpliedObject) {
|
||||||
int inheritanceDist= isReferenceRelated(cv1Target, cv2Source);
|
int inheritanceDist= isReferenceRelated(cv1Target, cv2Source);
|
||||||
if (inheritanceDist < 0)
|
if (inheritanceDist < 0)
|
||||||
return null;
|
return null;
|
||||||
|
@ -483,10 +482,9 @@ public class Conversions {
|
||||||
* @param isImplicitThis handles the special case when members of different
|
* @param isImplicitThis handles the special case when members of different
|
||||||
* classes are nominated via using-declarations. In such a situation the derived to
|
* classes are nominated via using-declarations. In such a situation the derived to
|
||||||
* base conversion does not cause any costs.
|
* base conversion does not cause any costs.
|
||||||
* @throws DOMException
|
|
||||||
*/
|
*/
|
||||||
private static final Cost checkStandardConversionSequence(IType source, boolean isLValue, IType target,
|
private static final Cost checkStandardConversionSequence(IType source, boolean isLValue, IType target,
|
||||||
boolean isImplicitThis) throws DOMException {
|
boolean isImplicitThis) {
|
||||||
final Cost cost= new Cost(source, target, Rank.IDENTITY);
|
final Cost cost= new Cost(source, target, Rank.IDENTITY);
|
||||||
if (lvalue_to_rvalue(cost, isLValue))
|
if (lvalue_to_rvalue(cost, isLValue))
|
||||||
return cost;
|
return cost;
|
||||||
|
@ -533,7 +531,7 @@ public class Conversions {
|
||||||
|
|
||||||
if (s instanceof ICPPClassType) {
|
if (s instanceof ICPPClassType) {
|
||||||
// 13.3.1.5 Initialization by conversion function
|
// 13.3.1.5 Initialization by conversion function
|
||||||
return initializationByConversion(source, (ICPPClassType) s, target);
|
return initializationByConversion(source, (ICPPClassType) s, target, isDirect);
|
||||||
}
|
}
|
||||||
return Cost.NO_CONVERSION;
|
return Cost.NO_CONVERSION;
|
||||||
}
|
}
|
||||||
|
@ -669,6 +667,8 @@ public class Conversions {
|
||||||
CPPTemplates.instantiateConversionTemplates(ops, target);
|
CPPTemplates.instantiateConversionTemplates(ops, target);
|
||||||
for (final ICPPMethod op : ops) {
|
for (final ICPPMethod op : ops) {
|
||||||
if (op != null && !(op instanceof IProblemBinding)) {
|
if (op != null && !(op instanceof IProblemBinding)) {
|
||||||
|
if (op.isExplicit())
|
||||||
|
continue;
|
||||||
final IType returnType = op.getType().getReturnType();
|
final IType returnType = op.getType().getReturnType();
|
||||||
final IType uqReturnType= getNestedType(returnType, REF | TDEF | CVTYPE);
|
final IType uqReturnType= getNestedType(returnType, REF | TDEF | CVTYPE);
|
||||||
final int dist = SemanticUtil.calculateInheritanceDepth(uqReturnType, t);
|
final int dist = SemanticUtil.calculateInheritanceDepth(uqReturnType, t);
|
||||||
|
@ -705,19 +705,25 @@ public class Conversions {
|
||||||
/**
|
/**
|
||||||
* 13.3.1.5 Initialization by conversion function [over.match.conv]
|
* 13.3.1.5 Initialization by conversion function [over.match.conv]
|
||||||
*/
|
*/
|
||||||
private static Cost initializationByConversion(IType source, ICPPClassType s, IType target) throws DOMException {
|
private static Cost initializationByConversion(IType source, ICPPClassType s, IType target, boolean direct) throws DOMException {
|
||||||
ICPPMethod[] ops = SemanticUtil.getConversionOperators(s);
|
ICPPMethod[] ops = SemanticUtil.getConversionOperators(s);
|
||||||
CPPTemplates.instantiateConversionTemplates(ops, target);
|
CPPTemplates.instantiateConversionTemplates(ops, target);
|
||||||
FunctionCost cost1= null;
|
FunctionCost cost1= null;
|
||||||
Cost cost2= null;
|
Cost cost2= null;
|
||||||
for (final ICPPMethod op : ops) {
|
for (final ICPPMethod op : ops) {
|
||||||
if (op != null && !(op instanceof IProblemBinding)) {
|
if (op != null && !(op instanceof IProblemBinding)) {
|
||||||
|
final boolean isExplicitConversion= op.isExplicit();
|
||||||
|
if (isExplicitConversion && !direct)
|
||||||
|
continue;
|
||||||
|
|
||||||
final IType returnType = op.getType().getReturnType();
|
final IType returnType = op.getType().getReturnType();
|
||||||
IType uqReturnType= getNestedType(returnType, TDEF | ALLCVQ);
|
IType uqReturnType= getNestedType(returnType, TDEF | ALLCVQ);
|
||||||
boolean isLValue = uqReturnType instanceof ICPPReferenceType
|
boolean isLValue = uqReturnType instanceof ICPPReferenceType
|
||||||
&& !((ICPPReferenceType) uqReturnType).isRValueReference();
|
&& !((ICPPReferenceType) uqReturnType).isRValueReference();
|
||||||
Cost c2= checkImplicitConversionSequence(target, uqReturnType, isLValue, UDCMode.noUDC, false);
|
Cost c2= checkImplicitConversionSequence(target, uqReturnType, isLValue, UDCMode.noUDC, false);
|
||||||
if (c2.converts()) {
|
if (c2.converts()) {
|
||||||
|
if (isExplicitConversion && c2.getRank() != Rank.IDENTITY)
|
||||||
|
continue;
|
||||||
ICPPFunctionType ftype = op.getType();
|
ICPPFunctionType ftype = op.getType();
|
||||||
IType implicitType= CPPSemantics.getImplicitType(op, ftype.isConst(), ftype.isVolatile());
|
IType implicitType= CPPSemantics.getImplicitType(op, ftype.isConst(), ftype.isVolatile());
|
||||||
final Cost udcCost = isReferenceCompatible(getNestedType(implicitType, TDEF | REF), source, true);
|
final Cost udcCost = isReferenceCompatible(getNestedType(implicitType, TDEF | REF), source, true);
|
||||||
|
@ -749,7 +755,7 @@ public class Conversions {
|
||||||
* [4.2] array-to-ptr
|
* [4.2] array-to-ptr
|
||||||
* [4.3] function-to-ptr
|
* [4.3] function-to-ptr
|
||||||
*/
|
*/
|
||||||
private static final boolean lvalue_to_rvalue(final Cost cost, boolean isLValue) throws DOMException {
|
private static final boolean lvalue_to_rvalue(final Cost cost, boolean isLValue) {
|
||||||
// target should not be a reference here.
|
// target should not be a reference here.
|
||||||
boolean isConverted= false;
|
boolean isConverted= false;
|
||||||
IType target = getNestedType(cost.target, REF | TDEF);
|
IType target = getNestedType(cost.target, REF | TDEF);
|
||||||
|
@ -824,9 +830,8 @@ public class Conversions {
|
||||||
/**
|
/**
|
||||||
* [4.4] Qualifications
|
* [4.4] Qualifications
|
||||||
* @param cost
|
* @param cost
|
||||||
* @throws DOMException
|
|
||||||
*/
|
*/
|
||||||
private static final boolean qualificationConversion(Cost cost) throws DOMException{
|
private static final boolean qualificationConversion(Cost cost) {
|
||||||
IType s = cost.source;
|
IType s = cost.source;
|
||||||
IType t = cost.target;
|
IType t = cost.target;
|
||||||
boolean constInEveryCV2k = true;
|
boolean constInEveryCV2k = true;
|
||||||
|
@ -894,9 +899,8 @@ public class Conversions {
|
||||||
* following that can hold it: int, unsigned int, long unsigned long.
|
* following that can hold it: int, unsigned int, long unsigned long.
|
||||||
* 4.5-4 bool can be promoted to int
|
* 4.5-4 bool can be promoted to int
|
||||||
* 4.6 float can be promoted to double
|
* 4.6 float can be promoted to double
|
||||||
* @throws DOMException
|
|
||||||
*/
|
*/
|
||||||
private static final boolean promotion(Cost cost) throws DOMException{
|
private static final boolean promotion(Cost cost) {
|
||||||
IType src = cost.source;
|
IType src = cost.source;
|
||||||
IType trg = cost.target;
|
IType trg = cost.target;
|
||||||
|
|
||||||
|
@ -980,7 +984,7 @@ public class Conversions {
|
||||||
* [4.10] Pointer conversions
|
* [4.10] Pointer conversions
|
||||||
* [4.11] Pointer to member conversions
|
* [4.11] Pointer to member conversions
|
||||||
*/
|
*/
|
||||||
private static final boolean conversion(Cost cost, boolean forImplicitThis) throws DOMException{
|
private static final boolean conversion(Cost cost, boolean forImplicitThis){
|
||||||
final IType s = cost.source;
|
final IType s = cost.source;
|
||||||
final IType t = cost.target;
|
final IType t = cost.target;
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
|
@ -259,4 +259,8 @@ class Cost {
|
||||||
public void setCouldNarrow() {
|
public void setCouldNarrow() {
|
||||||
fCouldNarrow= true;
|
fCouldNarrow= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICPPFunction getUserDefinedConversion() {
|
||||||
|
return fUserDefinedConversion;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -537,14 +537,12 @@ public class SemanticUtil {
|
||||||
* @param baseClass the class to find in the inheritance graph
|
* @param baseClass the class to find in the inheritance graph
|
||||||
* @return the number of edges in the inheritance graph, or -1 if the specified classes have
|
* @return the number of edges in the inheritance graph, or -1 if the specified classes have
|
||||||
* no inheritance relation
|
* no inheritance relation
|
||||||
* @throws DOMException
|
|
||||||
*/
|
*/
|
||||||
public static final int calculateInheritanceDepth(IType type, IType baseClass) throws DOMException {
|
public static final int calculateInheritanceDepth(IType type, IType baseClass) {
|
||||||
return calculateInheritanceDepth(CPPSemantics.MAX_INHERITANCE_DEPTH, type, baseClass);
|
return calculateInheritanceDepth(CPPSemantics.MAX_INHERITANCE_DEPTH, type, baseClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int calculateInheritanceDepth(int maxdepth, IType type, IType baseClass)
|
private static final int calculateInheritanceDepth(int maxdepth, IType type, IType baseClass) {
|
||||||
throws DOMException {
|
|
||||||
if (type == baseClass || type.isSameType(baseClass)) {
|
if (type == baseClass || type.isSameType(baseClass)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,4 @@ class CompositeCPPConstructor extends CompositeCPPMethod implements ICPPConstruc
|
||||||
public CompositeCPPConstructor(ICompositesFactory cf, ICPPFunction rbinding) {
|
public CompositeCPPConstructor(ICompositesFactory cf, ICPPFunction rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)rbinding).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,4 @@ public class CompositeCPPConstructorInstance extends CompositeCPPMethodInstance
|
||||||
public CompositeCPPConstructorInstance(ICompositesFactory cf, ICPPConstructor rbinding) {
|
public CompositeCPPConstructorInstance(ICompositesFactory cf, ICPPConstructor rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)rbinding).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,10 @@ package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
public class CompositeCPPConstructorSpecialization extends
|
public class CompositeCPPConstructorSpecialization extends CompositeCPPMethodSpecialization implements
|
||||||
CompositeCPPMethodSpecialization implements ICPPConstructor {
|
ICPPConstructor {
|
||||||
|
|
||||||
public CompositeCPPConstructorSpecialization(ICompositesFactory cf, ICPPConstructor cons) {
|
public CompositeCPPConstructorSpecialization(ICompositesFactory cf, ICPPConstructor cons) {
|
||||||
super(cf, cons);
|
super(cf, cons);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)rbinding).isExplicit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,4 @@ public class CompositeCPPConstructorTemplate extends CompositeCPPMethodTemplate
|
||||||
public CompositeCPPConstructorTemplate(ICompositesFactory cf, ICPPConstructor rbinding) {
|
public CompositeCPPConstructorTemplate(ICompositesFactory cf, ICPPConstructor rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)rbinding).isExplicit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,4 @@ public class CompositeCPPConstructorTemplateSpecialization
|
||||||
ICPPFunction ft) {
|
ICPPFunction ft) {
|
||||||
super(cf, ft);
|
super(cf, ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)rbinding).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,10 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod {
|
||||||
return ((ICPPMethod)rbinding).isImplicit();
|
return ((ICPPMethod)rbinding).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)rbinding).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return ((ICPPMethod)rbinding).isVirtual();
|
return ((ICPPMethod)rbinding).isVirtual();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,10 @@ public class CompositeCPPMethodInstance extends CompositeCPPFunctionInstance imp
|
||||||
return ((ICPPMethod)rbinding).isImplicit();
|
return ((ICPPMethod)rbinding).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)rbinding).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return ((ICPPMethod)rbinding).isDestructor();
|
return ((ICPPMethod)rbinding).isDestructor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,10 @@ implements ICPPMethod {
|
||||||
return ((ICPPMethod)rbinding).isImplicit();
|
return ((ICPPMethod)rbinding).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)rbinding).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return ((ICPPMethod)rbinding).isVirtual();
|
return ((ICPPMethod)rbinding).isVirtual();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,10 @@ public class CompositeCPPMethodTemplate extends CompositeCPPFunctionTemplate imp
|
||||||
return ((ICPPMethod)rbinding).isImplicit();
|
return ((ICPPMethod)rbinding).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)rbinding).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return ((ICPPMethod)rbinding).isVirtual();
|
return ((ICPPMethod)rbinding).isVirtual();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ public class CompositeCPPMethodTemplateSpecialization
|
||||||
return ((ICPPMethod)rbinding).isImplicit();
|
return ((ICPPMethod)rbinding).isImplicit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)rbinding).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return ((ICPPMethod)rbinding).isVirtual();
|
return ((ICPPMethod)rbinding).isVirtual();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
|
||||||
|
@ -37,7 +36,7 @@ class PDOMCPPAnnotation {
|
||||||
public static final int VIRTUAL_OFFSET = 0;
|
public static final int VIRTUAL_OFFSET = 0;
|
||||||
public static final int DESTRUCTOR_OFFSET = 1;
|
public static final int DESTRUCTOR_OFFSET = 1;
|
||||||
public static final int IMPLICIT_METHOD_OFFSET = 2;
|
public static final int IMPLICIT_METHOD_OFFSET = 2;
|
||||||
public static final int EXPLICIT_CONSTRUCTOR_OFFSET = 3;
|
public static final int EXPLICIT_METHOD_OFFSET = 3;
|
||||||
public static final int PURE_VIRTUAL_OFFSET = 4;
|
public static final int PURE_VIRTUAL_OFFSET = 4;
|
||||||
public static final int MAX_EXTRA_OFFSET= PURE_VIRTUAL_OFFSET;
|
public static final int MAX_EXTRA_OFFSET= PURE_VIRTUAL_OFFSET;
|
||||||
|
|
||||||
|
@ -92,12 +91,7 @@ class PDOMCPPAnnotation {
|
||||||
modifiers |= (method.isDestructor() ? 1 : 0) << DESTRUCTOR_OFFSET;
|
modifiers |= (method.isDestructor() ? 1 : 0) << DESTRUCTOR_OFFSET;
|
||||||
modifiers |= (method.isImplicit() ? 1 : 0) << IMPLICIT_METHOD_OFFSET;
|
modifiers |= (method.isImplicit() ? 1 : 0) << IMPLICIT_METHOD_OFFSET;
|
||||||
modifiers |= (method.isPureVirtual() ? 1 : 0) << PURE_VIRTUAL_OFFSET;
|
modifiers |= (method.isPureVirtual() ? 1 : 0) << PURE_VIRTUAL_OFFSET;
|
||||||
}
|
modifiers |= (method.isExplicit() ? 1 : 0) << EXPLICIT_METHOD_OFFSET;
|
||||||
if (binding instanceof ICPPConstructor) {
|
|
||||||
ICPPConstructor constructor= (ICPPConstructor) binding;
|
|
||||||
if (constructor.isExplicit()) {
|
|
||||||
modifiers |= (1 << EXPLICIT_CONSTRUCTOR_OFFSET);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return modifiers;
|
return modifiers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,6 @@ class PDOMCPPConstructor extends PDOMCPPMethod implements ICPPConstructor {
|
||||||
super(linkage, record);
|
super(linkage, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR;
|
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR;
|
||||||
|
|
|
@ -49,8 +49,4 @@ public class PDOMCPPConstructorInstance extends PDOMCPPMethodInstance implements
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_INSTANCE;
|
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)getTemplateDefinition()).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,4 @@ class PDOMCPPConstructorSpecialization extends
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_SPECIALIZATION;
|
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_SPECIALIZATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,10 +32,6 @@ class PDOMCPPConstructorTemplate extends PDOMCPPMethodTemplate implements
|
||||||
public PDOMCPPConstructorTemplate(PDOMLinkage linkage, long record) {
|
public PDOMCPPConstructorTemplate(PDOMLinkage linkage, long record) {
|
||||||
super(linkage, record);
|
super(linkage, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
|
|
|
@ -48,8 +48,4 @@ class PDOMCPPConstructorTemplateSpecialization extends
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_TEMPLATE_SPECIALIZATION;
|
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_TEMPLATE_SPECIALIZATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExplicit() {
|
|
||||||
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,6 +130,10 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
|
||||||
return getBit(getAnnotation1(), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
return getBit(getAnnotation1(), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_METHOD_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getFunctionScope() throws DOMException {
|
public IScope getFunctionScope() throws DOMException {
|
||||||
throw new PDOMNotImplementedError();
|
throw new PDOMNotImplementedError();
|
||||||
|
|
|
@ -71,6 +71,10 @@ class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMetho
|
||||||
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
|
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return ((ICPPMethod)getTemplateDefinition()).isExplicit();
|
||||||
|
}
|
||||||
|
|
||||||
public ICPPClassType getClassOwner() {
|
public ICPPClassType getClassOwner() {
|
||||||
return (ICPPClassType) getOwner();
|
return (ICPPClassType) getOwner();
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,10 @@ class PDOMCPPMethodSpecialization extends PDOMCPPFunctionSpecialization
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.EXPLICIT_METHOD_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.VIRTUAL_OFFSET);
|
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.VIRTUAL_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,10 @@ class PDOMCPPMethodTemplate extends PDOMCPPFunctionTemplate implements ICPPMetho
|
||||||
return getBit(getAnnotation1(), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
return getBit(getAnnotation1(), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_METHOD_OFFSET);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
return getBit(getAnnotation1(), PDOMCPPAnnotation.VIRTUAL_OFFSET);
|
return getBit(getAnnotation1(), PDOMCPPAnnotation.VIRTUAL_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,14 @@ class PDOMCPPMethodTemplateSpecialization extends
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExplicit() {
|
||||||
|
IBinding spec = getSpecializedBinding();
|
||||||
|
if (spec instanceof ICPPMethod) {
|
||||||
|
((ICPPMethod)spec).isExplicit();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual() {
|
public boolean isVirtual() {
|
||||||
IBinding spec = getSpecializedBinding();
|
IBinding spec = getSpecializedBinding();
|
||||||
|
|
|
@ -16,20 +16,20 @@ import java.net.URI;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||||
import org.eclipse.jface.viewers.LabelProvider;
|
import org.eclipse.jface.viewers.LabelProvider;
|
||||||
import org.eclipse.jface.viewers.StyledString;
|
import org.eclipse.jface.viewers.StyledString;
|
||||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
|
||||||
import org.eclipse.search.ui.text.AbstractTextSearchResult;
|
import org.eclipse.search.ui.text.AbstractTextSearchResult;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
import org.eclipse.ui.ISharedImages;
|
import org.eclipse.ui.ISharedImages;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexFileLocation;
|
import org.eclipse.cdt.core.index.IIndexFileLocation;
|
||||||
import org.eclipse.cdt.core.index.IndexLocationFactory;
|
import org.eclipse.cdt.core.index.IndexLocationFactory;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoLabelProvider;
|
import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoLabelProvider;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTProblem;
|
||||||
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||||
|
@ -121,7 +121,7 @@ public class PDOMSearchLabelProvider extends LabelProvider implements IStyledLab
|
||||||
}
|
}
|
||||||
else if (element instanceof ProblemSearchElement) {
|
else if (element instanceof ProblemSearchElement) {
|
||||||
ProblemSearchElement pse= (ProblemSearchElement) element;
|
ProblemSearchElement pse= (ProblemSearchElement) element;
|
||||||
return ASTSignatureUtil.getProblemMessage(pse.getProblemID(), pse.getDetail());
|
return ASTProblem.getMessage(pse.getProblemID(), pse.getDetail());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element instanceof IPath) {
|
if (element instanceof IPath) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue