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:
parent
a3fe799c39
commit
9c09cf1ebb
2 changed files with 18 additions and 1 deletions
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Add table
Reference in a new issue