mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
NPE in type-comparison, bug 238614.
This commit is contained in:
parent
eba71c1297
commit
51c06fe8cc
3 changed files with 12 additions and 4 deletions
|
@ -94,7 +94,7 @@ public class PDOMCBugsTest extends BaseTestCase {
|
|||
IFunctionType ft= (IFunctionType) type;
|
||||
assertEquals("int (int)", ASTTypeUtil.getType(ft));
|
||||
} else {
|
||||
assertNull("expected null, got "+type, type);
|
||||
assertTrue("expected ITypedef, got "+type, type == null || type instanceof ITypedef);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1771,7 +1771,9 @@ public class CPPVisitor {
|
|||
ICPPClassScope cScope = (ICPPClassScope) s;
|
||||
IType type = cScope.getClassType();
|
||||
if (type instanceof ICPPClassTemplate) {
|
||||
type = (IType) CPPTemplates.instantiateWithinClassTemplate((ICPPClassTemplate) type);
|
||||
IBinding within = CPPTemplates.instantiateWithinClassTemplate((ICPPClassTemplate) type);
|
||||
if (within instanceof ICPPClassType)
|
||||
type = (ICPPClassType)within;
|
||||
}
|
||||
if (dtor.isConst() || dtor.isVolatile())
|
||||
type = new CPPQualifierType(type, dtor.isConst(), dtor.isVolatile());
|
||||
|
|
|
@ -169,7 +169,10 @@ public class SemanticUtil {
|
|||
try {
|
||||
while( true ){
|
||||
if( type instanceof ITypedef ) {
|
||||
type= ((ITypedef)type).getType();
|
||||
IType tt= ((ITypedef)type).getType();
|
||||
if (tt == null)
|
||||
return type;
|
||||
type= tt;
|
||||
} else if( type instanceof IQualifierType ) {
|
||||
type= ((IQualifierType)type).getType();
|
||||
} else if( stopAtPointerToMember && type instanceof ICPPPointerToMemberType )
|
||||
|
@ -200,7 +203,10 @@ public class SemanticUtil {
|
|||
try {
|
||||
while( true ){
|
||||
if( type instanceof ITypedef ) {
|
||||
type = ((ITypedef)type).getType();
|
||||
IType tt= ((ITypedef)type).getType();
|
||||
if (tt == null)
|
||||
return type;
|
||||
type= tt;
|
||||
} else if( type instanceof IQualifierType ) {
|
||||
type = ((IQualifierType)type).getType();
|
||||
} else if( type instanceof ICPPReferenceType ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue