|
@@ -2347,8 +2347,8 @@ Sema::ActOnBaseSpecifier(Decl *classdecl, SourceRange SpecifierRange,
|
|
|
if (AL.isInvalid() || AL.getKind() == ParsedAttr::IgnoredAttribute)
|
|
|
continue;
|
|
|
Diag(AL.getLoc(), AL.getKind() == ParsedAttr::UnknownAttribute
|
|
|
- ? diag::warn_unknown_attribute_ignored
|
|
|
- : diag::err_base_specifier_attribute)
|
|
|
+ ? (unsigned)diag::warn_unknown_attribute_ignored
|
|
|
+ : (unsigned)diag::err_base_specifier_attribute)
|
|
|
<< AL.getName();
|
|
|
}
|
|
|
|
|
@@ -2867,14 +2867,14 @@ static const ParsedAttr *getMSPropertyAttr(const ParsedAttributesView &list) {
|
|
|
return nullptr;
|
|
|
}
|
|
|
|
|
|
-// Check if there is a field shadowing.
|
|
|
-void Sema::CheckShadowInheritedFields(const SourceLocation &Loc,
|
|
|
- DeclarationName FieldName,
|
|
|
- const CXXRecordDecl *RD,
|
|
|
- bool DeclIsField) {
|
|
|
- if (Diags.isIgnored(diag::warn_shadow_field, Loc))
|
|
|
- return;
|
|
|
-
|
|
|
+// Check if there is a field shadowing.
|
|
|
+void Sema::CheckShadowInheritedFields(const SourceLocation &Loc,
|
|
|
+ DeclarationName FieldName,
|
|
|
+ const CXXRecordDecl *RD,
|
|
|
+ bool DeclIsField) {
|
|
|
+ if (Diags.isIgnored(diag::warn_shadow_field, Loc))
|
|
|
+ return;
|
|
|
+
|
|
|
// To record a shadowed field in a base
|
|
|
std::map<CXXRecordDecl*, NamedDecl*> Bases;
|
|
|
auto FieldShadowed = [&](const CXXBaseSpecifier *Specifier,
|
|
@@ -2908,13 +2908,13 @@ void Sema::CheckShadowInheritedFields(const SourceLocation &Loc,
|
|
|
continue;
|
|
|
auto BaseField = It->second;
|
|
|
assert(BaseField->getAccess() != AS_private);
|
|
|
- if (AS_none !=
|
|
|
- CXXRecordDecl::MergeAccess(P.Access, BaseField->getAccess())) {
|
|
|
- Diag(Loc, diag::warn_shadow_field)
|
|
|
- << FieldName << RD << Base << DeclIsField;
|
|
|
- Diag(BaseField->getLocation(), diag::note_shadow_field);
|
|
|
- Bases.erase(It);
|
|
|
- }
|
|
|
+ if (AS_none !=
|
|
|
+ CXXRecordDecl::MergeAccess(P.Access, BaseField->getAccess())) {
|
|
|
+ Diag(Loc, diag::warn_shadow_field)
|
|
|
+ << FieldName << RD << Base << DeclIsField;
|
|
|
+ Diag(BaseField->getLocation(), diag::note_shadow_field);
|
|
|
+ Bases.erase(It);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|