forked from OSchip/llvm-project
Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.
llvm-svn: 131018
This commit is contained in:
parent
e2e4fe0d32
commit
83dc3e89c3
|
@ -936,7 +936,7 @@ public:
|
|||
Decl *HandleDeclarator(Scope *S, Declarator &D,
|
||||
MultiTemplateParamsArg TemplateParameterLists,
|
||||
bool IsFunctionDefinition,
|
||||
SourceLocation DefLoc = SourceLocation());
|
||||
SourceLocation DefaultLoc = SourceLocation());
|
||||
void RegisterLocallyScopedExternCDecl(NamedDecl *ND,
|
||||
const LookupResult &Previous,
|
||||
Scope *S);
|
||||
|
@ -965,7 +965,7 @@ public:
|
|||
MultiTemplateParamsArg TemplateParamLists,
|
||||
bool IsFunctionDefinition,
|
||||
bool &Redeclaration,
|
||||
SourceLocation DefLoc = SourceLocation());
|
||||
SourceLocation DefaultLoc = SourceLocation());
|
||||
bool AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD);
|
||||
void DiagnoseHiddenVirtualMethods(CXXRecordDecl *DC, CXXMethodDecl *MD);
|
||||
void CheckFunctionDeclaration(Scope *S,
|
||||
|
@ -3068,7 +3068,7 @@ public:
|
|||
Expr *BitfieldWidth, const VirtSpecifiers &VS,
|
||||
Expr *Init, bool IsDefinition,
|
||||
bool Deleted = false,
|
||||
SourceLocation DefLoc = SourceLocation());
|
||||
SourceLocation DefaultLoc = SourceLocation());
|
||||
|
||||
MemInitResult ActOnMemInitializer(Decl *ConstructorD,
|
||||
Scope *S,
|
||||
|
|
|
@ -967,9 +967,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
|
|||
|
||||
Actions.SetDeclDeleted(ThisDecl, DelLoc);
|
||||
} else if (Tok.is(tok::kw_default)) {
|
||||
SourceLocation DefLoc = ConsumeToken();
|
||||
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
Diag(ConsumeToken(), diag::err_default_special_members);
|
||||
} else {
|
||||
if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
|
||||
EnterScope(0);
|
||||
|
|
|
@ -1648,7 +1648,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
ExprResult BitfieldSize;
|
||||
ExprResult Init;
|
||||
bool Deleted = false;
|
||||
SourceLocation DefLoc;
|
||||
SourceLocation DefaultLoc;
|
||||
|
||||
while (1) {
|
||||
// member-declarator:
|
||||
|
@ -1683,7 +1683,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
} else if (Tok.is(tok::kw_default)) {
|
||||
if (!getLang().CPlusPlus0x)
|
||||
Diag(Tok, diag::warn_defaulted_function_accepted_as_extension);
|
||||
DefLoc = ConsumeToken();
|
||||
DefaultLoc = ConsumeToken();
|
||||
} else {
|
||||
Init = ParseInitializer();
|
||||
if (Init.isInvalid())
|
||||
|
@ -1711,8 +1711,8 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
|
||||
Decl *ThisDecl = 0;
|
||||
if (DS.isFriendSpecified()) {
|
||||
if (DefLoc.isValid())
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
if (DefaultLoc.isValid())
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
||||
// TODO: handle initializers, bitfields, 'delete'
|
||||
ThisDecl = Actions.ActOnFriendFunctionDecl(getCurScope(), DeclaratorInfo,
|
||||
|
@ -1725,7 +1725,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
BitfieldSize.release(),
|
||||
VS, Init.release(),
|
||||
/*IsDefinition*/Deleted,
|
||||
Deleted, DefLoc);
|
||||
Deleted, DefaultLoc);
|
||||
}
|
||||
if (ThisDecl)
|
||||
DeclsInGroup.push_back(ThisDecl);
|
||||
|
@ -1752,7 +1752,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
BitfieldSize = 0;
|
||||
Init = 0;
|
||||
Deleted = false;
|
||||
DefLoc = SourceLocation();
|
||||
DefaultLoc = SourceLocation();
|
||||
|
||||
// Attributes are only allowed on the second declarator.
|
||||
MaybeParseGNUAttributes(DeclaratorInfo);
|
||||
|
|
|
@ -2915,7 +2915,7 @@ bool Sema::DiagnoseClassNameShadow(DeclContext *DC,
|
|||
Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
|
||||
MultiTemplateParamsArg TemplateParamLists,
|
||||
bool IsFunctionDefinition,
|
||||
SourceLocation DefLoc) {
|
||||
SourceLocation DefaultLoc) {
|
||||
// TODO: consider using NameInfo for diagnostic.
|
||||
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
|
||||
DeclarationName Name = NameInfo.getName();
|
||||
|
@ -3116,8 +3116,8 @@ Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
|
|||
|
||||
bool Redeclaration = false;
|
||||
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
|
||||
if (DefLoc.isValid())
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
if (DefaultLoc.isValid())
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
||||
if (TemplateParamLists.size()) {
|
||||
Diag(D.getIdentifierLoc(), diag::err_template_typedef);
|
||||
|
@ -3128,9 +3128,10 @@ Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
|
|||
} else if (R->isFunctionType()) {
|
||||
New = ActOnFunctionDeclarator(S, D, DC, R, TInfo, Previous,
|
||||
move(TemplateParamLists),
|
||||
IsFunctionDefinition, Redeclaration, DefLoc);
|
||||
IsFunctionDefinition, Redeclaration,
|
||||
DefaultLoc);
|
||||
} else {
|
||||
assert(!DefLoc.isValid() && "We should have caught this in a caller");
|
||||
assert(!DefaultLoc.isValid() && "We should have caught this in a caller");
|
||||
New = ActOnVariableDeclarator(S, D, DC, R, TInfo, Previous,
|
||||
move(TemplateParamLists),
|
||||
Redeclaration);
|
||||
|
@ -4003,7 +4004,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
LookupResult &Previous,
|
||||
MultiTemplateParamsArg TemplateParamLists,
|
||||
bool IsFunctionDefinition, bool &Redeclaration,
|
||||
SourceLocation DefLoc) {
|
||||
SourceLocation DefaultLoc) {
|
||||
assert(R.getTypePtr()->isFunctionType());
|
||||
|
||||
// TODO: consider using NameInfo for diagnostic.
|
||||
|
@ -4060,7 +4061,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
bool isFunctionTemplateSpecialization = false;
|
||||
|
||||
if (!getLangOptions().CPlusPlus) {
|
||||
assert(!DefLoc.isValid() && "Defaulted functions are a C++ feature");
|
||||
assert(!DefaultLoc.isValid() && "Defaulted functions are a C++ feature");
|
||||
|
||||
// Determine whether the function was written with a
|
||||
// prototype. This true when:
|
||||
|
@ -4116,13 +4117,13 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
|
||||
NewFD = NewCD;
|
||||
|
||||
if (DefLoc.isValid()) {
|
||||
if (DefaultLoc.isValid()) {
|
||||
if (NewCD->isDefaultConstructor() ||
|
||||
NewCD->isCopyOrMoveConstructor()) {
|
||||
NewFD->setDefaulted();
|
||||
NewFD->setExplicitlyDefaulted();
|
||||
} else {
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
}
|
||||
}
|
||||
} else if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
|
||||
|
@ -4138,7 +4139,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
/*isImplicitlyDeclared=*/false);
|
||||
isVirtualOkay = true;
|
||||
|
||||
if (DefLoc.isValid()) {
|
||||
if (DefaultLoc.isValid()) {
|
||||
NewFD->setDefaulted();
|
||||
NewFD->setExplicitlyDefaulted();
|
||||
}
|
||||
|
@ -4160,8 +4161,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (DefLoc.isValid())
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
if (DefaultLoc.isValid())
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
||||
CheckConversionDeclarator(D, R, SC);
|
||||
NewFD = CXXConversionDecl::Create(Context, cast<CXXRecordDecl>(DC),
|
||||
|
@ -4211,18 +4212,18 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
|
||||
isVirtualOkay = !isStatic;
|
||||
|
||||
if (DefLoc.isValid()) {
|
||||
if (DefaultLoc.isValid()) {
|
||||
if (NewMD->isCopyAssignmentOperator() /* ||
|
||||
NewMD->isMoveAssignmentOperator() */) {
|
||||
NewFD->setDefaulted();
|
||||
NewFD->setExplicitlyDefaulted();
|
||||
} else {
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (DefLoc.isValid())
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
if (DefaultLoc.isValid())
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
||||
// Determine whether the function was written with a
|
||||
// prototype. This true when:
|
||||
|
|
|
@ -963,7 +963,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
|
|||
MultiTemplateParamsArg TemplateParameterLists,
|
||||
ExprTy *BW, const VirtSpecifiers &VS,
|
||||
ExprTy *InitExpr, bool IsDefinition,
|
||||
bool Deleted, SourceLocation DefLoc) {
|
||||
bool Deleted, SourceLocation DefaultLoc) {
|
||||
const DeclSpec &DS = D.getDeclSpec();
|
||||
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
|
||||
DeclarationName Name = NameInfo.getName();
|
||||
|
@ -1028,8 +1028,8 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
|
|||
if (isInstField) {
|
||||
CXXScopeSpec &SS = D.getCXXScopeSpec();
|
||||
|
||||
if (DefLoc.isValid())
|
||||
Diag(DefLoc, diag::err_default_special_members);
|
||||
if (DefaultLoc.isValid())
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
||||
if (SS.isSet() && !SS.isInvalid()) {
|
||||
// The user provided a superfluous scope specifier inside a class
|
||||
|
@ -1056,7 +1056,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
|
|||
assert(Member && "HandleField never returns null");
|
||||
} else {
|
||||
Member = HandleDeclarator(S, D, move(TemplateParameterLists), IsDefinition,
|
||||
DefLoc);
|
||||
DefaultLoc);
|
||||
if (!Member) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue