// Origin: PR c++/47398 // { dg-do compile } template struct A { typedef int INT; }; template struct transform { static int bar(); }; template struct B { typedef typename A::INT TINT; void baz(); }; template struct B { typedef typename A::INT TINT; void foo(); }; template void B::baz() { int c = transform::bar();//#0 } template void B::foo() { int c = transform::bar();//#1 } int main() { B i; i.foo(); // While instantiating // // template void B::foo() // // lookup_template_class resolves transform in #1 to // the wrong one; it picks up the one in #0 instead. This is because // to compare the two A comp_template_args uses cp_tree_equal // that fails to consider the number of siblings of parm 'a'. return 0; }