1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 495845 - Name resolution problem with SFINAE and trailing return

type

Change-Id: Ib3dff25c9e8c85b95a0e9cd1a7296fd9756b1511
This commit is contained in:
Sergey Prigogin 2016-06-10 17:45:53 -07:00
parent 03f0a71a3a
commit 78c15867f9
2 changed files with 16 additions and 0 deletions

View file

@ -7805,6 +7805,19 @@ public class AST2TemplateTests extends AST2TestBase {
parseAndCheckBindings();
}
// template <typename T>
// auto waldo(T p) -> decltype(undeclared(p));
//
// template <typename T>
// void waldo(T p);
//
// void test() {
// waldo(1);
// }
public void testSfinaeInTrailingReturnType_495845() throws Exception {
parseAndCheckBindings();
}
// template <typename>
// struct M {
// template <typename... Args>

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;
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.IValue;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization;
@ -330,6 +331,8 @@ public class EvalFunctionSet extends CPPDependentEvaluation {
// Perform template instantiation and overload resolution.
IBinding binding = CPPSemantics.resolveFunction(data, functions, true);
if (binding == null || binding instanceof IProblemBinding)
return EvalFixed.INCOMPLETE;
if (binding instanceof ICPPFunction && !(binding instanceof ICPPUnknownBinding))
return new EvalBinding(binding, null, getTemplateDefinition());
} catch (DOMException e) {