[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

John McCall rjmccall at apple.com
Thu Aug 20 00:23:01 PDT 2009


Chris Lattner wrote:
>> +/// 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.

Done in r79520.

>> +  // 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.

Fair enough.

>> +++ 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.

It turned out that this assert was trivialized by some dominating code, 
which wasn't originally the case (at least, not locally).  I just 
stripped it out.

John.



More information about the cfe-commits mailing list