summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-03-09 03:21:41 (EST)
committer Sergey Prigogin2013-03-09 17:39:14 (EST)
commit6190dce23278d3599f668d52120c6a3281f6d511 (patch)
treefab1666ac642a60b595c83f5dccf3d5ffb9c4ba1
parent7f2273c8b804669bec8b783f60db8a15300583ee (diff)
downloadorg.eclipse.cdt-6190dce23278d3599f668d52120c6a3281f6d511.zip
org.eclipse.cdt-6190dce23278d3599f668d52120c6a3281f6d511.tar.gz
org.eclipse.cdt-6190dce23278d3599f668d52120c6a3281f6d511.tar.bz2
Bug 402409 - Dependent expressions and auto type resolutionrefs/changes/14/11014/2
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>
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java5
2 files changed, 9 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
index 99e5d58..7ec5252 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java
@@ -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();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java
index 0f1fa43..1a9b23e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalID.java
@@ -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;
}