[cfe-dev] Access the definition of a class friend

Nikola Smiljanic popizdeh at gmail.com
Sat Jul 12 17:56:35 PDT 2014


FriendDecl::getFriendDecl returns a NamedDecl that you can cast to
appropriate subclass. You'll have to use FriendDecl::getFriendType if
you're interested in friend declaratons that were introduced in c++11

struct A;
struct B {
  friend A; // this doesn't forward declare A as opposed to 'friend struct
A'
};



On Sun, Jul 13, 2014 at 2:07 AM, Greenwalker <panagos13 at hotmail.com> wrote:

> Hi all!
>
> I am iterating through the friends of a CXXRecordDecl (via friend_iterator)
> but I cannot find a way to access the actual definitions of these friends
> if
> they exist (CXXRecordDecl if friend is a class or FunctionDecl if friend is
> a function).
>
> Any suggestions ?
>
> Thanks! :)
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Access-the-definition-of-a-class-friend-tp4040510.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140713/ba58c323/attachment.html>


More information about the cfe-dev mailing list