From 86dcb5b8d178717d46499d662ab383845df0b0b0 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 29 Jan 2013 16:48:13 -0800 Subject: Bug 399353 - Error involving __is_base_of Reviewed-on: https://git.eclipse.org/r/9989 Reviewed-by: Sergey Prigogin IP-Clean: Sergey Prigogin Tested-by: Sergey Prigogin --- .../eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java | 14 ++++++++++++++ .../core/dom/parser/cpp/CPPASTBinaryTypeIdExpression.java | 4 ++-- 2 files changed, 16 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 7abd5e5b9c1..cf82d2d8ee1 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 @@ -10087,4 +10087,18 @@ public class AST2CPPTests extends AST2TestBase { helper.assertNonProblemOnFirstIdentifier("fint({vbool"); helper.assertNonProblemOnFirstIdentifier("fint({vchar"); } + + // template + // struct enable_if { + // }; + // template <> + // struct enable_if { + // 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 7953101446d..a0a508069fc 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 { -- cgit v1.2.3