1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

bug 86372

This commit is contained in:
Andrew Niefer 2005-02-23 22:00:52 +00:00
parent 90832556ab
commit 3b61a8117e
2 changed files with 24 additions and 3 deletions

View file

@ -2124,5 +2124,23 @@ public class AST2CPPTests extends AST2BaseTest {
assertSame( refs[0], col.getName(4) );
assertSame( refs[1], col.getName(7) );
}
public void testBug86372() throws Exception {
StringBuffer buffer = new StringBuffer();
buffer.append("class A { \n"); //$NON-NLS-1$
buffer.append(" public: \n"); //$NON-NLS-1$
buffer.append(" template <class T> void f(T); \n"); //$NON-NLS-1$
buffer.append(" template <class T> struct X { }; \n"); //$NON-NLS-1$
buffer.append("}; \n"); //$NON-NLS-1$
buffer.append("class B : public A { \n"); //$NON-NLS-1$
buffer.append(" public: \n"); //$NON-NLS-1$
buffer.append(" using A::f<double>; // illformed \n"); //$NON-NLS-1$
buffer.append(" using A::X<int>; // illformed \n"); //$NON-NLS-1$
buffer.append("}; \n"); //$NON-NLS-1$
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.CPP);
CPPNameCollector col = new CPPNameCollector();
tu.getVisitor().visitTranslationUnit(col);
}
}

View file

@ -21,7 +21,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
* @author jcamelon
*/
public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId {
private static final char[] EMPTY_CHAR_ARRAY = { };
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private IASTName templateName;
/* (non-Javadoc)
@ -121,8 +122,10 @@ public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId {
* @see org.eclipse.cdt.core.dom.ast.IASTName#toCharArray()
*/
public char[] toCharArray() {
// TODO Auto-generated method stub
return null;
return EMPTY_CHAR_ARRAY;
}
public String toString() {
return EMPTY_STRING;
}
}