[patch, c++] Patch for PR c++/35109
Jason Merrill
jason@redhat.com
Sun Jan 11 20:40:00 GMT 2009
Steve Ellcey wrote:
> On Fri, 2009-01-09 at 16:12 -0500, Jason Merrill wrote:
>> Steve Ellcey wrote:
>>> I am not sure the comment is wrong, it is just a question of what to do
>>> when faced with an illegal program. Currently we ICE and with my change
>>> we return NULL which allows the compiler to generate error messages.
>> Yes, I agree with that change. But in this case we found a hidden name
>> and we aren't in a local class, so the comment "A non namespace-scope
>> binding can only be hidden if we are in a local class" is not quite
>> right. Rather, it can only be hidden in the presence of a local class,
>> but it can be found by lookups outside the local class, as in the testcase.
>
> But the test case is not a legal C++ program. So isn't the comment
> still true for legal C++ programs?
I think you could write a valid C++ program which trips this, but that's
not the point. The hidden binding persists beyond the local class,
whether or not you could look it up in a valid program. Thus, the
comment is making a demonstrably false assertion, and should be corrected.
Jason
More information about the Gcc-patches
mailing list