mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
properly handle classes with qualified names or template-ids in the name
This commit is contained in:
parent
56adc615f8
commit
4b27d3dac7
1 changed files with 4 additions and 3 deletions
|
@ -13,7 +13,6 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
|
@ -169,13 +168,15 @@ public class CPPClassType implements ICPPClassType, ICPPInternalClassType {
|
||||||
private IASTName [] declarations;
|
private IASTName [] declarations;
|
||||||
|
|
||||||
public CPPClassType( IASTName name ){
|
public CPPClassType( IASTName name ){
|
||||||
ASTNodeProperty prop = name.getPropertyInParent();
|
|
||||||
if( name instanceof ICPPASTQualifiedName ){
|
if( name instanceof ICPPASTQualifiedName ){
|
||||||
IASTName [] ns = ((ICPPASTQualifiedName)name).getNames();
|
IASTName [] ns = ((ICPPASTQualifiedName)name).getNames();
|
||||||
name = ns[ ns.length - 1 ];
|
name = ns[ ns.length - 1 ];
|
||||||
}
|
}
|
||||||
|
IASTNode parent = name.getParent();
|
||||||
|
while( parent instanceof IASTName )
|
||||||
|
parent = parent.getParent();
|
||||||
|
|
||||||
if( prop == IASTCompositeTypeSpecifier.TYPE_NAME )
|
if( parent instanceof IASTCompositeTypeSpecifier )
|
||||||
definition = name;
|
definition = name;
|
||||||
else
|
else
|
||||||
declarations = new IASTName[] { name };
|
declarations = new IASTName[] { name };
|
||||||
|
|
Loading…
Add table
Reference in a new issue