summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-01-29 02:48:19 (EST)
committerSergey Prigogin2013-01-29 17:31:14 (EST)
commit7112819c9b584acef60c6fb3c6e639fa03fdb04c (patch)
tree710d6714df130ddde7123e59be9fd64741b0375e
parent0cca070d73e448b31c259cc35edc47931835a00a (diff)
downloadorg.eclipse.cdt-7112819c9b584acef60c6fb3c6e639fa03fdb04c.zip
org.eclipse.cdt-7112819c9b584acef60c6fb3c6e639fa03fdb04c.tar.gz
org.eclipse.cdt-7112819c9b584acef60c6fb3c6e639fa03fdb04c.tar.bz2
Bug 399353 - Error involving __is_base_of refs/changes/89/9989/2
Change-Id: I93270040e75819c41705f0413d831ceaaf007131 Reviewed-on: https://git.eclipse.org/r/9989 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/AST2CPPTests.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java4
2 files changed, 15 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index b7f7c8b..7d28159 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -10125,4 +10125,17 @@ public class AST2CPPTests extends AST2TestBase {
parseAndCheckBindings(getAboveComment(), CPP, true);
}
+ // template <bool>
+ // struct enable_if {
+ // };
+ // template <>
+ // struct enable_if<true> {
+ // typedef void type;
+ // };
+ // struct base {};
+ // struct derived : base {};
+ // typedef enable_if<__is_base_of(base, derived)>::type T;
+ public void testIsBaseOf_399353() throws Exception {
+ parseAndCheckBindings(getAboveComment(), CPP, true);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java
index 7953101..a0a5080 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -124,7 +124,7 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
fEvaluation= EvalFixed.INCOMPLETE;
} else {
IType t1= CPPVisitor.createType(fOperand1);
- IType t2= CPPVisitor.createType(fOperand1);
+ IType t2= CPPVisitor.createType(fOperand2);
if (t1 == null || t2 == null) {
fEvaluation= EvalFixed.INCOMPLETE;
} else {