| author | Nathan Ridge | 2013-01-29 04:22:24 (EST) |
|---|---|---|
| committer | Sergey Prigogin | 2013-01-29 20:26:42 (EST) |
| commit | 9822ba56d8fb248df252acda23d79aeb1133cdee (patch) (side-by-side diff) | |
| tree | 901ad384853660a612df6c3819f39a334e9e6e01 | |
| parent | 3ebe4961cf4ae6a7d61d4fa71669a3bda9b276dc (diff) | |
| download | org.eclipse.cdt-9822ba56d8fb248df252acda23d79aeb1133cdee.zip org.eclipse.cdt-9822ba56d8fb248df252acda23d79aeb1133cdee.tar.gz org.eclipse.cdt-9822ba56d8fb248df252acda23d79aeb1133cdee.tar.bz2 | |
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>
| -rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java index 5d45beb..21c80c0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java @@ -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); |

