]> granicus.if.org Git - clang/commitdiff
Silences gcc's -Wnarrowing.
authorDaniel Jasper <djasper@google.com>
Wed, 3 May 2017 07:48:27 +0000 (07:48 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 3 May 2017 07:48:27 +0000 (07:48 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302003 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTWriter.cpp

index 69cdc37665c6c3874f4ea966c0c124309074409e..8e4b217a44cd1bc9d530be0821a82115d3692e2a 100644 (file)
@@ -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;
   };