This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch/RFC] PR 29143


Hi,

in this very old issue we reject:

void f(int,int);
void f(int,int,int);

void g ()
{
    (&f)(1,2,3);
}

with "address of overloaded function with no contextual type information".

It seems to me that handling the ADDR_EXPR close to the beginning of finish_call_expr goes a long way toward fixing the problem. As regards the existing testsuite, besided the obvious g++.old-deja/g++.other/overload11.C tweak, there is the sightly more interesting case of g++.dg/template/call4.C: withe the patch applied, we start rejecting it, because we notice that propGetDouble is private. AFAICS, that's progress, but in principle we should detect the access violation even earlier, when we pass the address of propGetDouble as template argument: the bug is already in Bugzilla (c++/48078, maybe there are dups too). Thus I think this testsuite tweak is also fine.

Tested x86_64-linux.

Thanks,
Paolo.

///////////////////////


Attachment: patch_29143
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]