From ba9aefc0ec758217e12381181c6f71035ee88fde Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 3 May 2017 07:48:27 +0000 Subject: [PATCH] Silences gcc's -Wnarrowing. I think this is a false positive in GCC's warning, but nonetheless, we should try to be warning-free. Smaller reproducer (reproduces with GCC 6.3): https://godbolt.org/g/cJuO2z llvm-svn: 302003 --- clang/lib/Serialization/ASTWriter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 69cdc37..8e4b217 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2872,8 +2872,9 @@ void ASTWriter::WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag, [](const DiagnosticsEngine::DiagState *DS) -> unsigned { unsigned Result = (unsigned)DS->ExtBehavior; for (unsigned Val : - {DS->IgnoreAllWarnings, DS->EnableAllWarnings, DS->WarningsAsErrors, - DS->ErrorsAsFatal, DS->SuppressSystemWarnings}) + {(unsigned)DS->IgnoreAllWarnings, (unsigned)DS->EnableAllWarnings, + (unsigned)DS->WarningsAsErrors, (unsigned)DS->ErrorsAsFatal, + (unsigned)DS->SuppressSystemWarnings}) Result = (Result << 1) | Val; return Result; }; -- 2.7.4