C++ PATCH for c++/51889 (problem overloading function using in template)
Jason Merrill
jason@redhat.com
Thu Jan 19 15:01:00 GMT 2012
When we have a class-scope using-declaration that nominates functions,
we want to insert those functions into the derived class'
CLASSTYPE_METHOD_VEC. In non-template code we do this in
handle_using_decl, which is called from check_bases_and_members. But we
don't call that function for a class template definition. Previously,
for templates we were inserting them from finish_member_declaration, but
that leads to name collisions if a function with the same signature is
declared after the using-declaration, as in this testcase. So this
patch delays inserting the used function until finish_struct time, to
match the non-template case.
Tested x86_64-pc-linux-gnu, applied to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 51889.patch
Type: text/x-patch
Size: 2406 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120119/38d45301/attachment.bin>
More information about the Gcc-patches
mailing list