mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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:
parent
95c1231336
commit
90bdc3c39c
1 changed files with 8 additions and 5 deletions
|
@ -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
|
* 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
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Nathan Ridge
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -47,8 +48,10 @@ public class CPPBaseClause implements ICPPBase, ICPPInternalBase {
|
||||||
public IType getBaseClassType() {
|
public IType getBaseClassType() {
|
||||||
if (baseClass == null) {
|
if (baseClass == null) {
|
||||||
IBinding b = base.getName().resolveBinding();
|
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());
|
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 {
|
} else {
|
||||||
baseClass= (IType) b;
|
baseClass= (IType) b;
|
||||||
IType check= getNestedType(baseClass, TDEF);
|
IType check= getNestedType(baseClass, TDEF);
|
||||||
|
|
Loading…
Add table
Reference in a new issue