[cfe-commits] r85060 - in /cfe/trunk: include/clang/Parse/Action.h lib/Sema/SemaDeclCXX.cpp

John McCall rjmccall at apple.com
Sun Oct 25 13:13:15 PDT 2009


Chris Lattner wrote:
> Author: lattner
> Date: Sun Oct 25 12:47:27 2009
> New Revision: 85060
>
> URL: http://llvm.org/viewvc/llvm-project?rev=85060&view=rev
> Log:
> change Sema::ActOnFriendTypeDecl to use GetTypeForDeclarator instead 
> of ConvertDeclSpecToType, which I'd like to keep private to SemaType.cpp.
> We do this by cons'ing up a trivial Declarator for the type.
>   

Thanks;  this is a good idea, and it'll make it easier to preserve 
source info, too.

> @@ -4282,9 +4281,11 @@
>    // Try to convert the decl specifier to a type.  This works for
>    // friend templates because ActOnTag never produces a ClassTemplateDecl
>    // for a TUK_Friend.
> -  bool invalid = false;
> -  QualType T = ConvertDeclSpecToType(DS, Loc, invalid);
> -  if (invalid) return DeclPtrTy();
> +  Declarator TheDeclarator(DS, Declarator::MemberContext);
> +  // TODO: Should use D.SetIdentifier() to specify where the identifier is?
> +  QualType T = GetTypeForDeclarator(TheDeclarator, S);
> +  if (TheDeclarator.isInvalidType())
> +    return DeclPtrTy()

I'm not sure what you're getting at with this TODO;  there is never an 
identifier in these declarations.

John.



More information about the cfe-commits mailing list