1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-17 14:05:23 +02:00

Bug 423471 - ClassCastException in CPPASTTemplateIDAmbiguity

This commit is contained in:
Sergey Prigogin 2013-12-06 11:38:43 -08:00
parent aa9dd95996
commit 1a4e509e0d

View file

@ -7,21 +7,25 @@
*
* Contributors:
* Nathan Ridge - Initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDecltypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.parser.Keywords;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
/**
* Implementation of ICPPASTDecltypeSpecifier.
*/
public class CPPASTDecltypeSpecifier extends ASTNode implements ICPPASTDecltypeSpecifier {
public class CPPASTDecltypeSpecifier extends ASTNode
implements ICPPASTDecltypeSpecifier, IASTAmbiguityParent {
private ICPPASTExpression fDecltypeExpression;
private char[] fSignature;
@ -78,4 +82,14 @@ public class CPPASTDecltypeSpecifier extends ASTNode implements ICPPASTDecltypeS
public IBinding resolvePreBinding() {
return resolveBinding();
}
@Override
public void replace(IASTNode child, IASTNode other) {
if (child == fDecltypeExpression) {
other.setPropertyInParent(child.getPropertyInParent());
other.setParent(child.getParent());
fDecltypeExpression = (ICPPASTExpression) other;
fSignature = null;
}
}
}