mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Revert "Bug 459940 - Sfinae in id-expression"
This reverts commit 5e2c5d8491
.
The change caused few regressions on my code base. Investigating.
Change-Id: I765b1fb5e730387ec3e91d4ecdfdb8c06db3e45e
This commit is contained in:
parent
384e9759c4
commit
a3147f85b0
4 changed files with 2 additions and 36 deletions
|
@ -7561,31 +7561,6 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<typename _From>
|
|
||||||
// struct is_convertible {};
|
|
||||||
//
|
|
||||||
// class function {
|
|
||||||
// public:
|
|
||||||
// template<typename _Functor, bool = is_convertible<_Functor>::type::value>
|
|
||||||
// function(_Functor);
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// class A {};
|
|
||||||
//
|
|
||||||
// struct B {
|
|
||||||
// B(const char* s);
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// template <class T> void waldo(const B& b);
|
|
||||||
// template <class T> void waldo(function f);
|
|
||||||
//
|
|
||||||
// void test() {
|
|
||||||
// waldo<A>(""); // problem on waldo
|
|
||||||
// }
|
|
||||||
public void testSfinaeInIdExpression_459940() throws Exception {
|
|
||||||
parseAndCheckBindings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// template <typename>
|
// template <typename>
|
||||||
// struct M {
|
// struct M {
|
||||||
// template <typename... Args>
|
// template <typename... Args>
|
||||||
|
|
|
@ -85,12 +85,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
public class Value implements IValue {
|
public class Value implements IValue {
|
||||||
public static final int MAX_RECURSION_DEPTH = 25;
|
public static final int MAX_RECURSION_DEPTH = 25;
|
||||||
// Value.UNKNOWN indicates general inability to determine a value. It doesn't have to be an error,
|
|
||||||
// it could be that evaluation ran into a performance limit, or that we can't model this kind of
|
|
||||||
// value (such as a pointer to a function).
|
|
||||||
public static final Value UNKNOWN= new Value("<unknown>".toCharArray(), null); //$NON-NLS-1$
|
public static final Value UNKNOWN= new Value("<unknown>".toCharArray(), null); //$NON-NLS-1$
|
||||||
// Value.ERROR indicates that an error, such as a substitution failure, occurred during evaluation.
|
|
||||||
public static final Value ERROR= new Value("<error>".toCharArray(), null); //$NON-NLS-1$
|
|
||||||
public static final Value NOT_INITIALIZED= new Value("<__>".toCharArray(), null); //$NON-NLS-1$
|
public static final Value NOT_INITIALIZED= new Value("<__>".toCharArray(), null); //$NON-NLS-1$
|
||||||
private static final IType INT_TYPE= new CPPBasicType(ICPPBasicType.Kind.eInt, 0);
|
private static final IType INT_TYPE= new CPPBasicType(ICPPBasicType.Kind.eInt, 0);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
public class EvalFixed extends CPPEvaluation {
|
public class EvalFixed extends CPPEvaluation {
|
||||||
public static final ICPPEvaluation INCOMPLETE =
|
public static final ICPPEvaluation INCOMPLETE =
|
||||||
new EvalFixed(ProblemType.UNKNOWN_FOR_EXPRESSION, PRVALUE, Value.ERROR);
|
new EvalFixed(ProblemType.UNKNOWN_FOR_EXPRESSION, PRVALUE, Value.UNKNOWN);
|
||||||
|
|
||||||
private final IType fType;
|
private final IType fType;
|
||||||
private final IValue fValue;
|
private final IValue fValue;
|
||||||
|
@ -170,10 +170,6 @@ public class EvalFixed extends CPPEvaluation {
|
||||||
IValue value = CPPTemplates.instantiateValue(fValue, tpMap, packOffset, within, maxdepth, point);
|
IValue value = CPPTemplates.instantiateValue(fValue, tpMap, packOffset, within, maxdepth, point);
|
||||||
if (type == fType && value == fValue)
|
if (type == fType && value == fValue)
|
||||||
return this;
|
return this;
|
||||||
// If an error occurred while instantiating the value (such as a substitution failure),
|
|
||||||
// propagate that error.
|
|
||||||
if (value == Value.ERROR)
|
|
||||||
return EvalFixed.INCOMPLETE;
|
|
||||||
return new EvalFixed(type, fValueCategory, value);
|
return new EvalFixed(type, fValueCategory, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class EvalID extends CPPDependentEvaluation {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldOwner instanceof IProblemBinding || nameOwner instanceof IProblemBinding)
|
if (fieldOwner instanceof IProblemBinding || nameOwner instanceof IProblemBinding)
|
||||||
return EvalFixed.INCOMPLETE;
|
return this;
|
||||||
|
|
||||||
if (templateArgs == fTemplateArgs && fieldOwner == fFieldOwner && nameOwner == fNameOwner)
|
if (templateArgs == fTemplateArgs && fieldOwner == fFieldOwner && nameOwner == fNameOwner)
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Add table
Reference in a new issue