Jason Merrill<jason@redhat.com> writes:
On 11/12/2010 06:47 AM, Dodji Seketeli wrote:
One possible way to do resolve that dilemma is [at the FE level] to
fixup the type of *ai to make it be A instead of the self-reference
type of A. I figure the fact that the self-reference type is different
from A itself should be kept as an implementation detail of the FE
anyway.
I think the typedef should be emitted so that name lookup in the
debugger can find it. TYPE_DECL_IS_STUB should not be true for the
injected-class-name.
Yes this makes a lot of sense. I initially got somewhat confused by this
code snippet in is_redundant_typedef:
if (DECL_ARTIFICIAL (decl)
&& DECL_CONTEXT (decl)
&& is_tagged_type (DECL_CONTEXT (decl))
&& TREE_CODE (TYPE_NAME (DECL_CONTEXT (decl))) == TYPE_DECL
&& DECL_NAME (decl) == DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))
/* Also ignore the artificial member typedef for the class name. */
return 1;
From what I understand it basically is tailored to not emit debug info
precisely for injected-class-names.