[c++] Question about "write_unscoped_name (const tree decl)"
Alexander Ivchenko
aivchenk@gmail.com
Mon Jul 29 11:14:00 GMT 2013
2013/7/29 Andreas Schwab <schwab@suse.de>:
> Alexander Ivchenko <aivchenk@gmail.com> writes:
>
>> BTW: First the check was "|| context == NULL", then it was removed by
>> r149964 and then came back as "|| context != NULL" by r153768.
>
> Looks like r153734 got it wrong first. It was supposed to revert
> r149964, but failed. Then r153742 reverted the revertion, and when
> r153768 reintroduced it it was apparently modeled after r153734 instead
> of the state before r149964.
Sounds like a riddle :)
Anyway, if we assume that r153734 got it wrong and hence it is now
wrong in the mainline, we can pull up the r149964 state with:
/* If not, it should be either in the global namespace, or directly
in a local function scope. */
gcc_assert (context == global_namespace
- || context != NULL
+ || context == NULL
|| TREE_CODE (context) == FUNCTION_DECL);
but then we will get ICE with g++.dg/cpp0x/lambda/lambda-defarg3.C,
which would be a problem itself.
--Alexander
More information about the Gcc
mailing list