mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 04:45:38 +02:00
type of new-expression, bug 264163.
This commit is contained in:
parent
7e4bb073a8
commit
91d6659911
3 changed files with 14 additions and 2 deletions
|
@ -6706,4 +6706,16 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
ba.assertNonProblem("fip(0)", 3, ICPPFunction.class);
|
||||
ba.assertNonProblem("fia(0)", 3, ICPPFunction.class);
|
||||
}
|
||||
|
||||
// class cl {};
|
||||
// typedef cl tl;
|
||||
// void reset(cl* ptr){};
|
||||
// void blatest() {
|
||||
// reset(new tl());
|
||||
// reset(new cl());
|
||||
// }
|
||||
public void testTypeOfNewExpression_264163() throws Exception {
|
||||
String code= getAboveComment();
|
||||
parseAndCheckBindings(code, ParserLanguage.CPP);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,6 +209,7 @@ public class CPPASTNewExpression extends ASTNode implements
|
|||
}
|
||||
|
||||
public IType getExpressionType() {
|
||||
return CPPVisitor.createType(getTypeId());
|
||||
IType t= CPPVisitor.createType(getTypeId());
|
||||
return new CPPPointerType(t);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1706,7 +1706,6 @@ public class CPPVisitor extends ASTQueries {
|
|||
if (binding instanceof ICPPConstructor) {
|
||||
try {
|
||||
type= ((ICPPConstructor) binding).getClassOwner();
|
||||
type = new CPPPointerType(type);
|
||||
} catch (DOMException e) {
|
||||
type = e.getProblem();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue