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 a5c5a40f052..3cc0a6c8e5f 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 @@ -10747,6 +10747,17 @@ public class AST2CPPTests extends AST2TestBase { public void testBasePointerConverstionInConditional_462705() throws Exception { parseAndCheckBindings(); } + + // struct S {}; + // typedef S* S_ptr; + // void waldo(S*); + // S_ptr s; + // int main() { + // waldo(false ? s : 0); + // } + public void testTypedefOfPointerInConditional_481078() throws Exception { + parseAndCheckBindings(); + } // template // struct enable_if { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java index c46f939b156..5b99304a3ae 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/Conversions.java @@ -1170,6 +1170,8 @@ public class Conversions { * the pointer is not possible, the method returns {@code null}. */ public static IType compositePointerType(IType t1, IType t2, IASTNode point) { + t1 = SemanticUtil.getNestedType(t1, TDEF); + t2 = SemanticUtil.getNestedType(t2, TDEF); final boolean isPtr1 = t1 instanceof IPointerType; if (isPtr1 || isNullPtr(t1)) { if (isNullPointerConstant(t2)) {