From: Joerg Sonnenberger Date: Wed, 26 Jun 2013 21:31:47 +0000 (+0000) Subject: Don't use unnamed local enums as template arguments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7348454025693dd20a411c2bcaabd4460cb87559;p=clang Don't use unnamed local enums as template arguments. Fixes -Werror bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185023 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 1295339aa3..d6e2fd235e 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -1123,7 +1123,7 @@ static void diagnoseRepeatedUseOfWeak(Sema &S, // Show the first time the object was read. S.Diag(FirstRead->getLocStart(), DiagKind) - << ObjectKind << D << FunctionKind + << int(ObjectKind) << D << int(FunctionKind) << FirstRead->getSourceRange(); // Print all the other accesses as notes. diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp index b59198c03f..3c361970b1 100644 --- a/lib/Sema/SemaCast.cpp +++ b/lib/Sema/SemaCast.cpp @@ -765,10 +765,10 @@ static void DiagnoseReinterpretUpDownCast(Sema &Self, const Expr *SrcExpr, SourceLocation BeginLoc = OpRange.getBegin(); Self.Diag(BeginLoc, diag::warn_reinterpret_different_from_static) - << DerivedType << BaseType << !VirtualBase << ReinterpretKind + << DerivedType << BaseType << !VirtualBase << int(ReinterpretKind) << OpRange; Self.Diag(BeginLoc, diag::note_reinterpret_updowncast_use_static) - << ReinterpretKind + << int(ReinterpretKind) << FixItHint::CreateReplacement(BeginLoc, "static_cast"); } diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index a818d37459..8afff70daa 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1485,8 +1485,8 @@ static bool checkMethodFamilyMismatch(Sema &S, ObjCMethodDecl *impl, reasonSelector = R_NonObjectReturn; } - S.Diag(impl->getLocation(), errorID) << familySelector << reasonSelector; - S.Diag(decl->getLocation(), noteID) << familySelector << reasonSelector; + S.Diag(impl->getLocation(), errorID) << int(familySelector) << int(reasonSelector); + S.Diag(decl->getLocation(), noteID) << int(familySelector) << int(reasonSelector); return true; } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 2059a1e076..218eeef71a 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -372,7 +372,7 @@ void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc, // the sentinel, and the args after the sentinel, complain. if (Args.size() < numFormalParams + numArgsAfterSentinel + 1) { Diag(Loc, diag::warn_not_enough_argument) << D->getDeclName(); - Diag(D->getLocation(), diag::note_sentinel_here) << calleeType; + Diag(D->getLocation(), diag::note_sentinel_here) << int(calleeType); return; } @@ -398,12 +398,12 @@ void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc, NullValue = "(void*) 0"; if (MissingNilLoc.isInvalid()) - Diag(Loc, diag::warn_missing_sentinel) << calleeType; + Diag(Loc, diag::warn_missing_sentinel) << int(calleeType); else Diag(MissingNilLoc, diag::warn_missing_sentinel) - << calleeType + << int(calleeType) << FixItHint::CreateInsertion(MissingNilLoc, ", " + NullValue); - Diag(D->getLocation(), diag::note_sentinel_here) << calleeType; + Diag(D->getLocation(), diag::note_sentinel_here) << int(calleeType); } SourceRange Sema::getExprRange(Expr *E) const { diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index e1f0739aea..72a6d1aaf9 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -3864,7 +3864,7 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type, max = Qualifiers::MaxAddressSpace; if (addrSpace > max) { S.Diag(Attr.getLoc(), diag::err_attribute_address_space_too_high) - << Qualifiers::MaxAddressSpace << ASArgExpr->getSourceRange(); + << int(Qualifiers::MaxAddressSpace) << ASArgExpr->getSourceRange(); Attr.setInvalid(); return; }