Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2019-03-09 22:51:04 +0000
committerNathan Ridge2019-03-09 22:51:04 +0000
commit77c35208302591eb1702c9bf52c30d3f280f5566 (patch)
treef25a6a98114a771ecb0afc7ce2da7f03126ac7b7
parentaa57218c1da7411a41299472a9461e5df823980c (diff)
downloadorg.eclipse.cdt-77c35208302591eb1702c9bf52c30d3f280f5566.tar.gz
org.eclipse.cdt-77c35208302591eb1702c9bf52c30d3f280f5566.tar.xz
org.eclipse.cdt-77c35208302591eb1702c9bf52c30d3f280f5566.zip
Revert "Bug 543913 - False negative in ctor with wrong arguments"
This reverts commit e5466b8204c8c903c36e43e0c9d5c4ea9d83a942. This is being reverted on the 9.7 branch due to causing bug 545021. Change-Id: I5e3d507fd1bad103ac12746e5f63146b7bda9259
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionCallExpression.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java2
3 files changed, 1 insertions, 31 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 43a8fd83eb2..74d7b0a0358 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -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];
// };
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionCallExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionCallExpression.java
index fa084f408f8..3917785ac1f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionCallExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionCallExpression.java
@@ -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) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index e899187cc0d..dfad90333ee 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -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);

Back to the top