diff options
author | Kaelyn Uhrain <rikka@google.com> | 2011-10-11 00:28:45 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2011-10-11 00:28:45 +0000 |
commit | 2c712f50cd56eaf3662989b556e9c6b1e8fcd11a (patch) | |
tree | e85b8897e1b6096adc8777d2e87bc57d58cd1887 /lib/Sema/SemaDeclCXX.cpp | |
parent | 2afd76618ee35193172c764d25f1f0996765b5e7 (diff) |
Move some bool flags out of function parameter lists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e9e9d5eb3d..a7370cfcad 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1432,8 +1432,7 @@ Decl * Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BW, const VirtSpecifiers &VS, - bool HasDeferredInit, - bool IsDefinition) { + bool HasDeferredInit) { const DeclSpec &DS = D.getDeclSpec(); DeclarationNameInfo NameInfo = GetNameForDeclarator(D); DeclarationName Name = NameInfo.getName(); @@ -1544,7 +1543,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, } else { assert(!HasDeferredInit); - Member = HandleDeclarator(S, D, move(TemplateParameterLists), IsDefinition); + Member = HandleDeclarator(S, D, move(TemplateParameterLists)); if (!Member) { return 0; } @@ -10140,7 +10139,7 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, return D; } -Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, +Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParams) { const DeclSpec &DS = D.getDeclSpec(); @@ -10149,7 +10148,6 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, SourceLocation Loc = D.getIdentifierLoc(); TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S); - QualType T = TInfo->getType(); // C++ [class.friend]p1 // A friend of a class is a function or class.... @@ -10161,7 +10159,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, // a declaration that does not use the syntactic form of a // function declarator to have a function type, the program // is ill-formed. - if (!T->isFunctionType()) { + if (!TInfo->getType()->isFunctionType()) { Diag(Loc, diag::err_unexpected_friend); // It might be worthwhile to try to recover by creating an @@ -10268,7 +10266,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, // A function can be defined in a friend declaration of a class if and // only if the class is a non-local class (9.8), the function name is // unqualified, and the function has namespace scope. - if (isLocal && IsDefinition) { + if (isLocal && D.isFunctionDefinition()) { Diag(NameInfo.getBeginLoc(), diag::err_friend_def_in_local_class); } @@ -10297,7 +10295,8 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, if (Previous.empty()) { D.setInvalidType(); - Diag(Loc, diag::err_qualified_friend_not_found) << Name << T; + Diag(Loc, diag::err_qualified_friend_not_found) + << Name << TInfo->getType(); return 0; } @@ -10306,7 +10305,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, if (DC->Equals(CurContext)) Diag(DS.getFriendSpecLoc(), diag::err_friend_is_member); - if (IsDefinition) { + if (D.isFunctionDefinition()) { // C++ [class.friend]p6: // A function can be defined in a friend declaration of a class if and // only if the class is a non-local class (9.8), the function name is @@ -10326,7 +10325,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, // - There's a scope specifier that does match some template // parameter lists, which we don't handle right now. } else { - if (IsDefinition) { + if (D.isFunctionDefinition()) { // C++ [class.friend]p6: // A function can be defined in a friend declaration of a class if and // only if the class is a non-local class (9.8), the function name is @@ -10350,13 +10349,10 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, return 0; } } - - bool Redeclaration = false; + bool AddToScope = true; - NamedDecl *ND = ActOnFunctionDeclarator(DCScope, D, DC, T, TInfo, Previous, - move(TemplateParams), - IsDefinition, - Redeclaration, AddToScope); + NamedDecl *ND = ActOnFunctionDeclarator(DCScope, D, DC, TInfo, Previous, + move(TemplateParams), AddToScope); if (!ND) return 0; assert(ND->getDeclContext() == DC); |