]> granicus.if.org Git - clang/commitdiff
Add syntax examples for the friend declaration types.
authorJohn McCall <rjmccall@apple.com>
Thu, 20 Aug 2009 07:19:42 +0000 (07:19 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 20 Aug 2009 07:19:42 +0000 (07:19 +0000)
Remove an assert trivialized by dominating code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79520 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclCXX.h
lib/Sema/SemaDeclCXX.cpp

index 3642fcbec6ac122735120b00b156bc9ecea4924c..327f9ff622de94f43c21bbd3bc2f74e9ebe92712 100644 (file)
@@ -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)
index e2aee5b136ef75ac560cd4a22d1d3727a8f56c58..aa4ac8f1b0db6d609d95ee0a5b3b726c3bbd47ed 100644 (file)
@@ -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.