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 8d0874e9236..08589ff17fd 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 @@ -2356,7 +2356,44 @@ public class AST2TemplateTests extends AST2BaseTest { } } } - + + // template + // struct allocator { + // template + // struct rebind { + // typedef allocator<_Tp1> other; + // }; + // }; + // + // template > + // struct _Rb_tree { + // typedef _Val1 value_type1; + // }; + // + // template > + // struct map { + // typedef _Val2 value_type2; + // typedef typename _Alloc2::template rebind::other _Val_alloc_type; + // typedef _Rb_tree<_Val2, _Val_alloc_type> _Rep_type; + // typedef typename _Rep_type::value_type1 value_type; + // }; + // + // void f(map::value_type r) {} + public void _testRebindPattern_236197() throws Exception { + IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.CPP, true, true); + CPPNameCollector col = new CPPNameCollector(); + tu.accept(col); + for (IASTName name : col.nameList) { + if ("r".equals(String.valueOf(name))) { + IBinding b0 = name.resolveBinding(); + IType type = ((ICPPVariable) b0).getType(); + type = getUltimateType(type, false); + assertInstance(type, IBasicType.class); + assertEquals("int", ASTTypeUtil.getType(type)); + } + } + } + // template // struct IterTraits { // typedef typename _Iterator::iter_reference traits_reference;