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

Bug 402409 - Dependent expressions and auto type resolution

Change-Id: Ic391705ea80adf28a4d664198c79817d54e9bddd
Reviewed-on: https://git.eclipse.org/r/11014
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:
Nathan Ridge 2013-03-09 03:21:41 -05:00 committed by Sergey Prigogin
parent 7f2273c8b8
commit 6190dce232
2 changed files with 9 additions and 4 deletions

View file

@ -5904,11 +5904,15 @@ public class AST2TemplateTests extends AST2TestBase {
// };
//
// template<class Container>
// auto begin(Container cont) -> decltype(cont.begin());
// auto begin1(Container cont) -> decltype(cont.begin());
//
// template<class Container>
// auto begin2(Container& cont) -> decltype(cont.begin());
//
// int main() {
// vector v;
// begin(v);
// begin1(v);
// begin2(v);
// }
public void testResolvingAutoTypeWithDependentExpression_402409b() throws Exception {
parseAndCheckBindings();

View file

@ -329,9 +329,10 @@ public class EvalID extends CPPDependentEvaluation {
if (fieldOwner != null && !fieldOwner.isTypeDependent()) {
IType fieldOwnerType = fieldOwner.getTypeOrFunctionSet(point);
IType fieldOwnerClassType = SemanticUtil.getNestedType(fieldOwnerType, TDEF | REF | CVTYPE);
IType fieldOwnerClassTypeCV = SemanticUtil.getNestedType(fieldOwnerType, TDEF | REF);
IType fieldOwnerClassType = SemanticUtil.getNestedType(fieldOwnerClassTypeCV, CVTYPE);
if (fieldOwnerClassType instanceof ICPPClassType) {
ICPPEvaluation eval = resolveName((ICPPClassType) fieldOwnerClassType, templateArgs, fieldOwnerType, point);
ICPPEvaluation eval = resolveName((ICPPClassType) fieldOwnerClassType, templateArgs, fieldOwnerClassTypeCV, point);
if (eval != null)
return eval;
}