[cfe-commits] r79520 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/Sema/SemaDeclCXX.cpp
John McCall
rjmccall at apple.com
Thu Aug 20 00:19:42 PDT 2009
Author: rjmccall
Date: Thu Aug 20 02:19:42 2009
New Revision: 79520
URL: http://llvm.org/viewvc/llvm-project?rev=79520&view=rev
Log:
Add syntax examples for the friend declaration types.
Remove an assert trivialized by dominating code.
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=79520&r1=79519&r2=79520&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Thu Aug 20 02:19:42 2009
@@ -1263,7 +1263,13 @@
};
/// 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 @@
};
/// 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)
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=79520&r1=79519&r2=79520&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Aug 20 02:19:42 2009
@@ -3422,7 +3422,6 @@
// 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.
More information about the cfe-commits
mailing list