1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 98666- template names

This commit is contained in:
Andrew Niefer 2005-06-20 15:48:29 +00:00
parent a3fe799c39
commit 9c09cf1ebb
2 changed files with 18 additions and 1 deletions

View file

@ -30,6 +30,8 @@ import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
@ -1748,4 +1750,17 @@ public class AST2TemplateTests extends AST2BaseTest {
assertSame( add, col.getName(16).resolveBinding() );
}
public void testBug98666() throws Exception {
StringBuffer buffer = new StringBuffer();
IASTTranslationUnit tu = parse( "A::template B<T> b;", ParserLanguage.CPP );
CPPNameCollector col = new CPPNameCollector();
tu.accept( col );
ICPPASTQualifiedName qn = (ICPPASTQualifiedName) col.getName(0);
IASTName [] ns = qn.getNames();
assertTrue( ns[1] instanceof ICPPASTTemplateId );
assertEquals( ((ICPPASTTemplateId)ns[1]).toString(), "B" );
}
}

View file

@ -442,7 +442,9 @@ public class BasicTokenDuple implements ITokenDuple {
if( i == null )
return EMPTY_STRING;
else if( i.getType() == IToken.t_template )
i = i.getNext();
char[] tempArray = i.getCharImage();
if( i == last )