This is the mail archive of the gcc@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]

Re: PATCH RFC: Proposed patch for PR c++/7874


Ian Lance Taylor wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> 
> 
>>Let's start with the simpler friend10.C.  There, the "operator bool()"
>>conversion operator is irrelevant, as far as I can see.  However, we
>>*should* still call the friend operator<<, because argument-dependent
>>lookup is explicitly defined that way.
>>
>>So, in that particular form of lookup, you should ignore
>>DECL_ANTICIPATED -- but only if the friend was declared in one of the
>>classes that's in the set of special classes.  I guess, without changing
>>our representation, you get to go through each of the DECL_ANTICIPATED
>>friends, and then call is_friend (fn, c) for each c in the set of
>>argument-dependent classes.  That's wort-case quadratic, and we could
>>make it cleverer, but I'd start with that.
> 
> 
> Thanks for the analysis.
> 
> Naturally, addressing that issue caused another problem, namely
> g++.old-deja/g++.jason/scoping15.C. 

That case is not valid C++.  Probably, you should add -ffriend-inject to
the test case; that will test that the new switch does what it should!

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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