diff options
-rw-r--r-- | include/clang/AST/DeclCXX.h | 19 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 3642fcbec6..327f9ff622 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -1263,7 +1263,13 @@ public: }; /// FriendFunctionDecl - Represents the declaration (and possibly -/// the definition) of a friend function. +/// the definition) of a friend function. For example: +/// +/// @code +/// class A { +/// friend int foo(int); +/// }; +/// @endcode class FriendFunctionDecl : public FunctionDecl { // Location of the 'friend' specifier. const SourceLocation FriendLoc; @@ -1293,13 +1299,20 @@ public: }; /// FriendClassDecl - Represents the declaration of a friend class. +/// For example: +/// +/// @code +/// class X { +/// friend class Y; +/// }; +/// @endcode 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; + QualType FriendType; // Location of the 'friend' specifier. - const SourceLocation FriendLoc; + SourceLocation FriendLoc; FriendClassDecl(DeclContext *DC, SourceLocation L, QualType T, SourceLocation FriendL) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e2aee5b136..aa4ac8f1b0 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3422,7 +3422,6 @@ Sema::DeclPtrTy Sema::ActOnFriendDecl(Scope *S, // The record declaration we get from friend declarations is not // canonicalized; see ActOnTag. - assert(RD); // C++ [class.friend]p2: A class shall not be defined inside // a friend declaration. |