1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 399363 - ClassCastException in CPPBaseClause.getBaseClassType()

Change-Id: Ia7f168648b739334982b7e0728250fbb663bd1c5
Reviewed-on: https://git.eclipse.org/r/9994
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Nathan Ridge 2013-01-29 04:22:24 -05:00 committed by Sergey Prigogin
parent 95c1231336
commit 90bdc3c39c

View file

@ -1,14 +1,15 @@
/*******************************************************************************
* Copyright (c) 2004, 2010 IBM Corporation and others.
* Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems)
* Andrew Niefer (IBM Corporation) - initial API and implementation
* Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems)
* Nathan Ridge
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -47,8 +48,10 @@ public class CPPBaseClause implements ICPPBase, ICPPInternalBase {
public IType getBaseClassType() {
if (baseClass == null) {
IBinding b = base.getName().resolveBinding();
if (b instanceof IProblemBinding || ! (b instanceof IType)) {
if (b instanceof IProblemBinding) {
baseClass = new CPPClassType.CPPClassTypeProblem(base.getName(), ((IProblemBinding) b).getID());
} else if (!(b instanceof IType)) {
baseClass = new CPPClassType.CPPClassTypeProblem(base.getName(), ISemanticProblem.BINDING_NO_CLASS);
} else {
baseClass= (IType) b;
IType check= getNestedType(baseClass, TDEF);