mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
bug 86372
This commit is contained in:
parent
90832556ab
commit
3b61a8117e
2 changed files with 24 additions and 3 deletions
|
@ -2124,5 +2124,23 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertSame( refs[0], col.getName(4) );
|
assertSame( refs[0], col.getName(4) );
|
||||||
assertSame( refs[1], col.getName(7) );
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId {
|
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;
|
private IASTName templateName;
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -121,8 +122,10 @@ public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId {
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IASTName#toCharArray()
|
* @see org.eclipse.cdt.core.dom.ast.IASTName#toCharArray()
|
||||||
*/
|
*/
|
||||||
public char[] toCharArray() {
|
public char[] toCharArray() {
|
||||||
// TODO Auto-generated method stub
|
return EMPTY_CHAR_ARRAY;
|
||||||
return null;
|
}
|
||||||
|
public String toString() {
|
||||||
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue