mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 388623 - [regression] Error involving dependent expressions
Change-Id: I5d32ca41b7d87d0f220b192889e3908a0f7c84fd Reviewed-on: https://git.eclipse.org/r/9057 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
6697364dce
commit
a9cbaf44fc
2 changed files with 28 additions and 1 deletions
|
@ -6883,7 +6883,23 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
assertEquals("bool", ASTTypeUtil.getType(td.getType()));
|
assertEquals("bool", ASTTypeUtil.getType(td.getType()));
|
||||||
ah.assertProblem("B<int*>::type", "type");
|
ah.assertProblem("B<int*>::type", "type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <typename From>
|
||||||
|
// struct is_convertible {
|
||||||
|
// static char check(From);
|
||||||
|
// static From from;
|
||||||
|
// static const int value = sizeof(check(from));
|
||||||
|
// };
|
||||||
|
// template <int>
|
||||||
|
// struct S {
|
||||||
|
// typedef int type;
|
||||||
|
// };
|
||||||
|
// struct Cat {};
|
||||||
|
// typedef S<is_convertible<Cat>::value>::type T;
|
||||||
|
public void testDependentExpressionInvolvingField_388623() throws Exception {
|
||||||
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
|
}
|
||||||
|
|
||||||
// struct S {
|
// struct S {
|
||||||
// typedef int a_type;
|
// typedef int a_type;
|
||||||
// };
|
// };
|
||||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.cdt.core.dom.ast.IValue;
|
||||||
import org.eclipse.cdt.core.dom.ast.IVariable;
|
import org.eclipse.cdt.core.dom.ast.IVariable;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassSpecialization;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
|
@ -351,6 +352,16 @@ public class EvalBinding extends CPPEvaluation {
|
||||||
binding = CPPTemplates.createSpecialization((ICPPClassSpecialization) owner,
|
binding = CPPTemplates.createSpecialization((ICPPClassSpecialization) owner,
|
||||||
binding, point);
|
binding, point);
|
||||||
}
|
}
|
||||||
|
} else if (binding instanceof ICPPField) {
|
||||||
|
IBinding owner = binding.getOwner();
|
||||||
|
if (owner instanceof ICPPClassTemplate) {
|
||||||
|
owner = resolveUnknown(CPPTemplates.createDeferredInstance((ICPPClassTemplate) owner),
|
||||||
|
tpMap, packOffset, within, point);
|
||||||
|
}
|
||||||
|
if (owner instanceof ICPPClassSpecialization) {
|
||||||
|
binding = CPPTemplates.createSpecialization((ICPPClassSpecialization) owner,
|
||||||
|
binding, point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (binding == fBinding)
|
if (binding == fBinding)
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Add table
Reference in a new issue