C++ PATCH: PR 2922

Douglas Gregor doug.gregor@gmail.com
Sat May 28 23:57:00 GMT 2005


Hello,

This amusingly small patch fixes PR 2922 (two-stage lookup for unqualified 
function calls with type-dependent arguments). We need only keep the set of 
functions we found in the first stage, and it will be augmented by those 
functions found using argument-dependent lookup at the second stage. Also, we 
explicitly deal with DR 164 by not optimizing away checks for functions found 
via ADL in the namespace of the template.

Note that this only fixes two-stage lookup for function names. Operations are 
still handled improperly. I've reported PR c++/21802 that illustrates this 
problem. The testcase from that PR is included in this testsuite patch.

Tested i686-pc-linux-gnu. No new regressions on the g++ or libstdc++ test 
suites. The new tests (from PR 2922) pass; the new one from PR 21802 is 
XFAIL'd; some tests needed tweaking because error-messages changed or the 
test should not have been passing in the first place.

Okay for mainline? 

 Doug Gregor

2005-05-28  Douglas Gregor <doug.gregor@gmail.com>

 PR c++/2922
 * semantics.c (perform_koenig_lookup): For dependent calls, just
 return the set of functions we've found so far. Later, it will be
 augmented by those found through argument-dependent lookup.
 * name-lookup.c (lookup_arg_dependent): 

2005-05-28  Douglas Gregor <doug.gregor@gmail.com>

 PR c++/2922
 * g++.dg/lookup/two-stage2.C: New.
 * g++.dg/lookup/two-stage3.C: New.
 * g++.dg/lookup/two-stage4.C: New. Illustrates how we have not yet
 fixed two-stage name lookup for operators.
 * g++.dg/template/call3.C: Compiler now produces an appropriate
 error message. 
 * g++.dg/template/crash37.C: Compiler now describes bla() on line
 14 as a candidate. 
 * g++.dg/template/ptrmem4.C: Compiler produces different error
 message.
 * g++.old-deja/g++.other/pmf3.C: Compiler now describes
 connect_to_method as a candidate.
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2922-cp.patch
Type: text/x-diff
Size: 3017 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050528/d449b6be/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2922-testsuite.patch
Type: text/x-diff
Size: 5266 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050528/d449b6be/attachment-0001.bin>


More information about the Gcc mailing list