[cfe-commits] r78719 - in /cfe/trunk: include/clang/AST/DeclCXX.h include/clang/AST/DeclNodes.def lib/AST/DeclBase.cpp lib/AST/DeclCXX.cpp lib/Sema/SemaDeclCXX.cpp
Chris Lattner
clattner at apple.com
Wed Aug 19 23:21:26 PDT 2009
On Aug 11, 2009, at 2:13 PM, John McCall wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=78719&view=rev
> Log:
> Add a FriendClassDecl type for holding declarations of friend types in
> the AST, and create such declarations.
Hi John,
>
> +/// FriendClassDecl - Represents the declaration of a friend class.
> +class FriendClassDecl : public Decl {
Please add a syntax example for this, showing a minimal example that
would generate one of these.
> + // 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;
We usually don't declare instance variables as const. I'm not
strongly opposed to it, but it seems that it will need to change
anyway when PCH for C++ happens.
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Aug 11 16:13:21 2009
...
> + // The record declaration we get from friend declarations is
> not
> + // canonicalized; see ActOnTag.
> + assert(RD);
Please add a message to asserts. When this fires, it would be useful
to know why you think RD should be non-null here.
Thanks!
-Chris
More information about the cfe-commits
mailing list