diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 36 | ||||
-rw-r--r-- | include/clang/AST/DeclNodes.def | 1 |
2 files changed, 37 insertions, 0 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 4ca9a8222e..ff498ba4a4 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -1273,6 +1273,42 @@ public: static bool classof(const FriendFunctionDecl *D) { return true; } }; +/// FriendClassDecl - Represents the declaration of a friend class. +class FriendClassDecl : public Decl { + // The friended type. In C++0x, this can be an arbitrary type, + // which we simply ignore if it's not a record type. + const QualType FriendType; + + // Location of the 'friend' specifier. + const SourceLocation FriendLoc; + + FriendClassDecl(DeclContext *DC, SourceLocation L, + QualType T, SourceLocation FriendL) + : Decl(FriendClass, DC, L), + FriendType(T), + FriendLoc(FriendL) + {} + +public: + static FriendClassDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, QualType T, + SourceLocation FriendL); + + QualType getFriendType() const { + return FriendType; + } + + SourceLocation getFriendLoc() const { + return FriendLoc; + } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { + return D->getKind() == FriendClass; + } + static bool classof(const FriendClassDecl *D) { return true; } +}; + /// LinkageSpecDecl - This represents a linkage specification. For example: /// extern "C" void foo(); /// diff --git a/include/clang/AST/DeclNodes.def b/include/clang/AST/DeclNodes.def index 8d5c0681d7..0cf092ffba 100644 --- a/include/clang/AST/DeclNodes.def +++ b/include/clang/AST/DeclNodes.def @@ -125,6 +125,7 @@ DECL(ObjCPropertyImpl, Decl) DECL(ObjCForwardProtocol, Decl) DECL(ObjCClass, Decl) DECL(FileScopeAsm, Decl) +DECL(FriendClass, Decl) DECL(StaticAssert, Decl) LAST_DECL(Block, Decl) |