1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 18:25:40 +02:00

Revert "Bug 543913 - False negative in ctor with wrong arguments"

This reverts commit e5466b8204.

This is being reverted on the 9.7 branch due to causing bug 545021.

Change-Id: I5e3d507fd1bad103ac12746e5f63146b7bda9259
This commit is contained in:
Nathan Ridge 2019-03-09 17:51:04 -05:00
parent aa57218c1d
commit 77c3520830
3 changed files with 1 additions and 31 deletions

View file

@ -12841,24 +12841,6 @@ public class AST2CPPTests extends AST2CPPTestBase {
bh.assertImplicitName("a0", 2, IProblemBinding.class);
}
// struct type {
// type(int a) {}
// };
//
// struct other_type {};
//
// int main() {
// type(1, 2);
// type{1, 2};
// type(other_type());
// }
public void testCtorWithWrongArguments_543913() throws Exception {
BindingAssertionHelper bh = getAssertionHelper();
bh.assertImplicitName("type(1, 2)", 4, IProblemBinding.class);
bh.assertImplicitName("type{1, 2}", 4, IProblemBinding.class);
bh.assertImplicitName("type(other_type())", 4, IProblemBinding.class);
}
// struct array{
// int data[1];
// };

View file

@ -33,7 +33,6 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference;
@ -133,14 +132,6 @@ public class CPPASTFunctionCallExpression extends ASTNode
if (overload == null)
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
if (overload instanceof IProblemBinding) {
CPPASTImplicitName overloadName = null;
overloadName = new CPPASTImplicitName(overload.getNameCharArray(), this);
overloadName.setBinding(overload);
overloadName.setOffsetAndLength((ASTNode) getFunctionNameExpression());
return fImplicitNames = new IASTImplicitName[] { overloadName };
}
if (getEvaluation() instanceof EvalTypeId) {
CPPASTImplicitName n1 = new CPPASTImplicitName(overload.getNameCharArray(), this);
n1.setOffsetAndLength((ASTNode) fFunctionName);
@ -273,9 +264,6 @@ public class CPPASTFunctionCallExpression extends ASTNode
try {
ICPPConstructor[] constructors = cls.getConstructors();
IBinding b = CPPSemantics.resolveFunction(data, constructors, true, false);
if (b instanceof IProblemBinding && !(b instanceof ICPPFunction))
b = new CPPFunction.CPPFunctionProblem(data.getLookupName(),
((IProblemBinding) b).getID());
if (b instanceof ICPPFunction)
return (ICPPFunction) b;
} catch (DOMException e) {

View file

@ -2759,7 +2759,7 @@ public class CPPSemantics {
if (bestFnCost == null) {
if (unknownFunction == null)
return new ProblemBinding(lookupName, lookupPoint, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, fns);
return null;
setTargetedFunctionsToUnknown(argTypes);
return CPPDeferredFunction.createForCandidates(fns);