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);
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,
Expr *BitfieldWidth, const VirtSpecifiers &VS,
Expr *Init, bool IsDefinition,
bool Deleted = false,
- SourceLocation DefLoc = SourceLocation());
+ SourceLocation DefaultLoc = SourceLocation());
MemInitResult ActOnMemInitializer(Decl *ConstructorD,
Scope *S,
ExprResult BitfieldSize;
ExprResult Init;
bool Deleted = false;
- SourceLocation DefLoc;
+ SourceLocation DefaultLoc;
while (1) {
// member-declarator:
} 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())
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,
BitfieldSize.release(),
VS, Init.release(),
/*IsDefinition*/Deleted,
- Deleted, DefLoc);
+ Deleted, DefaultLoc);
}
if (ThisDecl)
DeclsInGroup.push_back(ThisDecl);
BitfieldSize = 0;
Init = 0;
Deleted = false;
- DefLoc = SourceLocation();
+ DefaultLoc = SourceLocation();
// Attributes are only allowed on the second declarator.
MaybeParseGNUAttributes(DeclaratorInfo);
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();
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);
} 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);
LookupResult &Previous,
MultiTemplateParamsArg TemplateParamLists,
bool IsFunctionDefinition, bool &Redeclaration,
- SourceLocation DefLoc) {
+ SourceLocation DefaultLoc) {
assert(R.getTypePtr()->isFunctionType());
// TODO: consider using NameInfo for diagnostic.
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:
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) {
/*isImplicitlyDeclared=*/false);
isVirtualOkay = true;
- if (DefLoc.isValid()) {
+ if (DefaultLoc.isValid()) {
NewFD->setDefaulted();
NewFD->setExplicitlyDefaulted();
}
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),
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:
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();
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
assert(Member && "HandleField never returns null");
} else {
Member = HandleDeclarator(S, D, move(TemplateParameterLists), IsDefinition,
- DefLoc);
+ DefaultLoc);
if (!Member) {
return 0;
}