diff options
author | John McCall <rjmccall@apple.com> | 2009-09-11 21:02:39 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-09-11 21:02:39 +0000 |
commit | 2f212b3a72b1dbc89346830fa2bcf861a8d2f785 (patch) | |
tree | a232582e31ba80c032a35d8b9e6bca03d20cb98c /clang/lib/Parse | |
parent | c0f8eef71085f472fee402afa90eecac8c0ce98e (diff) | |
download | bcm5719-llvm-2f212b3a72b1dbc89346830fa2bcf861a8d2f785.tar.gz bcm5719-llvm-2f212b3a72b1dbc89346830fa2bcf861a8d2f785.zip |
Alter Action's friend interface to prepare for templated friend declarations and
to stop making promises we can't currently keep.
llvm-svn: 81571
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r-- | clang/lib/Parse/ParseCXXInlineMethods.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index 82b7da9f68e..c34653ee425 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -34,7 +34,7 @@ Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, Declarator &D, DeclPtrTy FnD; if (D.getDeclSpec().isFriendSpecified()) // FIXME: Friend templates - FnD = Actions.ActOnFriendDecl(CurScope, &D, /*IsDefinition*/ true); + FnD = Actions.ActOnFriendFunctionDecl(CurScope, D, true, move(TemplateParams)); else // FIXME: pass template information through FnD = Actions.ActOnCXXMemberDeclarator(CurScope, AS, D, move(TemplateParams), 0, 0); diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index bb268e70c00..b9a0d6165e7 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1019,7 +1019,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) return; - Actions.ActOnFriendDecl(CurScope, &DS, /*IsDefinition*/ false); + Actions.ActOnFriendTypeDecl(CurScope, DS); } else Actions.ParsedFreeStandingDeclSpec(CurScope, DS); @@ -1122,15 +1122,17 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, // this call will *not* return the created decl; It will return null. // See Sema::ActOnCXXMemberDeclarator for details. + Action::MultiTemplateParamsArg TemplateParams(Actions, + TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->data() : 0, + TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->size() : 0); + DeclPtrTy ThisDecl; if (DS.isFriendSpecified()) { - // TODO: handle initializers, bitfields, 'delete', friend templates - ThisDecl = Actions.ActOnFriendDecl(CurScope, &DeclaratorInfo, - /*IsDefinition*/ false); + // TODO: handle initializers, bitfields, 'delete' + ThisDecl = Actions.ActOnFriendFunctionDecl(CurScope, DeclaratorInfo, + /*IsDefinition*/ false, + move(TemplateParams)); } else { - Action::MultiTemplateParamsArg TemplateParams(Actions, - TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->data() : 0, - TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->size() : 0); ThisDecl = Actions.ActOnCXXMemberDeclarator(CurScope, AS, DeclaratorInfo, move(TemplateParams), |