[cfe-dev] template specialization and redecls

Douglas Gregor dgregor at apple.com
Mon Nov 29 16:08:59 PST 2010


On Nov 29, 2010, at 4:07 PM, Craig Silverstein wrote:

> } e.g., friend declarations don't show up in the redeclaration chain
> } when they should.
> 
> When might a friend declaration have a redeclarations in the same
> DeclContext?  I'm sure it's possible, I just can't think of how.

They won't occur in the same (lexical) DeclContext; they'll all be in the same semantic DeclContext, because they're declaring the same entity.

> } It's at the point where we need to implement a completely different
> } approach to finding friends.
> 
> Sounds like it's above my paygrade. :-)

It's a nontrivial amount of work. I can elaborate if anyone feels like tackling this ;)

> This bug is causing me a small bit of trouble for
> include-what-you-use.  One easy way around it, for me, would be if I
> could tell, when traversing redecls, whether a particular declaration
> was part of a friend declaration or not.  Is there anything that would
> tell me that?

IIRC, it's Decl::getFriendObjectKind().

	- Doug



More information about the cfe-dev mailing list