mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 18:15:23 +02:00
229942: add test
This commit is contained in:
parent
532bcc93b8
commit
3fb7973084
1 changed files with 15 additions and 0 deletions
|
@ -24,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType;
|
import org.eclipse.cdt.core.dom.ast.IBasicType;
|
||||||
|
@ -2428,4 +2429,18 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ICPPFunction fn= bh.assertNonProblem("foo(cx", 3, ICPPFunction.class);
|
ICPPFunction fn= bh.assertNonProblem("foo(cx", 3, ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template<int x>
|
||||||
|
// class A {};
|
||||||
|
//
|
||||||
|
// const int i= 1;
|
||||||
|
// A<i> a1;
|
||||||
|
public void _testNonTypeArgumentIsIDExpression_229942() throws Exception {
|
||||||
|
IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.CPP, true, true );
|
||||||
|
CPPNameCollector col = new CPPNameCollector();
|
||||||
|
tu.accept(col);
|
||||||
|
|
||||||
|
assertInstance(col.getName(4).getParent(), ICPPASTTemplateId.class);
|
||||||
|
assertInstance(col.getName(5).getParent(), IASTIdExpression.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue