Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2008-04-14 11:06:30 +0000
committerAndrew Ferguson2008-04-14 11:06:30 +0000
commitd29b51bbd45c84fe0aa26f423c5025f18df0fab6 (patch)
tree974288f6e193046cfbaf06e58fc2c212c783e296 /core/org.eclipse.cdt.core
parentcba049ddbe901d0c60a946b24c6f84941ec4e060 (diff)
downloadorg.eclipse.cdt-d29b51bbd45c84fe0aa26f423c5025f18df0fab6.tar.gz
org.eclipse.cdt-d29b51bbd45c84fe0aa26f423c5025f18df0fab6.tar.xz
org.eclipse.cdt-d29b51bbd45c84fe0aa26f423c5025f18df0fab6.zip
226308: Disable fix for 224364
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java21
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java4
3 files changed, 29 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
index 66c5a161b5..dfe31fb72c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java
@@ -41,6 +41,10 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassInstance;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassSpecialization;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPPointerType;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding;
@@ -147,8 +151,15 @@ class Conversions {
}
}
+ boolean checkConversionOperators=
+ (SemanticUtil.ENABLE_224364 && s instanceof ICPPClassType)
+ || (s instanceof CPPClassType
+ || s instanceof CPPClassTemplate
+ || s instanceof CPPClassSpecialization
+ || s instanceof CPPClassInstance);
+
//conversion operators
- if( s instanceof ICPPClassType ){
+ if (checkConversionOperators) {
ICPPMethod [] ops = SemanticUtil.getConversionOperators((ICPPClassType)s);
if( ops.length > 0 && !(ops[0] instanceof IProblemBinding) ){
Cost [] costs = null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
index a9e1021de8..5d4389a856 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
@@ -42,16 +42,23 @@ public class SemanticUtil {
*/
private static final CharArraySet cas= new CharArraySet(OverloadableOperator.values().length);
+ /**
+ * Switch for enabling fix for bug 224364
+ */
+ public static final boolean ENABLE_224364= System.getProperty("cdt.enable.224364") != null; //$NON-NLS-1$
+
static {
+ final int OPERATOR_SPC= OPERATOR_CHARS.length + 1;
for(OverloadableOperator op : OverloadableOperator.values()) {
- cas.put(op.toCharArray());
+ char[] name= op.toCharArray();
+ cas.put(CharArrayUtils.subarray(name, OPERATOR_SPC, name.length));
}
}
/**
* Returns a list of ICPPMethod objects representing all conversion operators
- * declared by the specified class. It does not include inherited methods. Conversion
- * operators can not be implicit.
+ * declared by the specified class. This does not include inherited methods. Conversion
+ * operators cannot be implicit.
* @param clazz
* @return List of ICPPMethod
*/
@@ -70,8 +77,8 @@ public class SemanticUtil {
/**
* Returns a list of ICPPMethod objects representing all conversion operators
- * declared by the specified class and its ancestors. It does not include inherited
- * methods. Conversion operators can not be implicit.
+ * declared by the specified class and its ancestors. This includes inherited
+ * methods. Conversion operators cannot be implicit.
* @param clazz
* @return List of ICPPMethod
*/
@@ -120,9 +127,9 @@ public class SemanticUtil {
/**
* @param method
- * @return true is the specified method is a conversion operator
+ * @return true if the specified method is a conversion operator
*/
- private static final boolean isConversionOperator(ICPPMethod method) {
+ public static final boolean isConversionOperator(ICPPMethod method) {
boolean result= false;
if(!method.isImplicit()) {
final char[] name= method.getNameCharArray();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index eefc9d90b2..d953d9080a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -264,7 +264,9 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
if ((pdomBinding instanceof PDOMCPPClassInstance || pdomBinding instanceof PDOMCPPDeferredClassInstance) && binding instanceof ICPPClassType) {
// Add instantiated constructors to the index (bug 201174).
addConstructors(pdomBinding, (ICPPClassType) binding);
- addConversionOperators(pdomBinding, (ICPPClassType) binding);
+ if(SemanticUtil.ENABLE_224364) {
+ addConversionOperators(pdomBinding, (ICPPClassType) binding);
+ }
}
}
} catch (DOMException e) {

Back to the top