r349342 - Fix "enumeral mismatch in conditional expression" gcc7 warnings. NFCI.
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 17 04:17:37 PST 2018
Author: rksimon
Date: Mon Dec 17 04:17:37 2018
New Revision: 349342
URL: http://llvm.org/viewvc/llvm-project?rev=349342&view=rev
Log:
Fix "enumeral mismatch in conditional expression" gcc7 warnings. NFCI.
Modified:
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=349342&r1=349341&r2=349342&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Dec 17 04:17:37 2018
@@ -6103,9 +6103,10 @@ static void ProcessDeclAttribute(Sema &S
// though they were unknown attributes.
if (AL.getKind() == ParsedAttr::UnknownAttribute ||
!AL.existsInTarget(S.Context.getTargetInfo())) {
- S.Diag(AL.getLoc(), AL.isDeclspecAttribute()
- ? diag::warn_unhandled_ms_attribute_ignored
- : diag::warn_unknown_attribute_ignored)
+ S.Diag(AL.getLoc(),
+ AL.isDeclspecAttribute()
+ ? (unsigned)diag::warn_unhandled_ms_attribute_ignored
+ : (unsigned)diag::warn_unknown_attribute_ignored)
<< AL;
return;
}
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=349342&r1=349341&r2=349342&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Dec 17 04:17:37 2018
@@ -2347,8 +2347,8 @@ Sema::ActOnBaseSpecifier(Decl *classdecl
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 *getMSPropertyAt
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(co
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);
+ }
}
}
More information about the cfe-commits
mailing list