mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Workaround for bug 182972, no PDOMCArrayType.
This commit is contained in:
parent
e085fd2c3e
commit
7184f3a57d
1 changed files with 18 additions and 12 deletions
|
@ -12,11 +12,13 @@ package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IArrayType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICArrayType;
|
import org.eclipse.cdt.core.dom.ast.c.ICArrayType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author dsteffle
|
* @author dsteffle
|
||||||
|
@ -36,18 +38,22 @@ public class CArrayType implements ICArrayType, ITypeContainer {
|
||||||
if( obj instanceof ITypedef )
|
if( obj instanceof ITypedef )
|
||||||
return obj.isSameType( this );
|
return obj.isSameType( this );
|
||||||
if( obj instanceof ICArrayType ){
|
if( obj instanceof ICArrayType ){
|
||||||
ICArrayType at = (ICArrayType) obj;
|
ICArrayType at = (ICArrayType) obj;
|
||||||
try {
|
try {
|
||||||
if( isConst() != at.isConst() ) return false;
|
if( isConst() != at.isConst() ) return false;
|
||||||
if( isRestrict() != at.isRestrict() ) return false;
|
if( isRestrict() != at.isRestrict() ) return false;
|
||||||
if( isStatic() != at.isStatic() ) return false;
|
if( isStatic() != at.isStatic() ) return false;
|
||||||
if( isVolatile() != at.isVolatile() ) return false;
|
if( isVolatile() != at.isVolatile() ) return false;
|
||||||
if( isVariableLength() != at.isVariableLength() ) return false;
|
if( isVariableLength() != at.isVariableLength() ) return false;
|
||||||
|
|
||||||
return at.getType().isSameType( type );
|
return at.getType().isSameType( type );
|
||||||
} catch ( DOMException e ) {
|
} catch ( DOMException e ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// work around for bug 182976, no PDOMCArrayType.
|
||||||
|
else if (obj instanceof IArrayType && obj instanceof IIndexType) {
|
||||||
|
return obj.isSameType(this);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue