mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 337686: Function-call on dependent expression.
This commit is contained in:
parent
5aa57c8075
commit
4276eda033
2 changed files with 11 additions and 0 deletions
|
@ -5258,4 +5258,12 @@ public class AST2TemplateTests extends AST2BaseTest {
|
|||
public void testSyntaxErrorInReturnTypeOfFunctionInstance_Bug336426() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename T> struct A {};
|
||||
// template <typename Functor> void f(Functor functor) {
|
||||
// A<decltype(functor())> a;
|
||||
// }
|
||||
public void testFunctionCallOnDependentName_Bug337686() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||
|
||||
|
||||
|
@ -250,6 +251,8 @@ public class CPPASTFunctionCallExpression extends ASTNode implements
|
|||
if (t instanceof IFunctionType) {
|
||||
return typeFromReturnType(((IFunctionType) t).getReturnType());
|
||||
}
|
||||
if (CPPTemplates.isDependentType(t))
|
||||
return CPPUnknownClass.createUnnamedInstance();
|
||||
|
||||
return new ProblemType(ISemanticProblem.TYPE_UNKNOWN_FOR_EXPRESSION);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue