[clang-tools-extra] r334091 - Fix MSVC 'implicit double to float truncation and 'not all control paths return a value' warnings. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 6 05:48:27 PDT 2018


Author: rksimon
Date: Wed Jun  6 05:48:27 2018
New Revision: 334091

URL: http://llvm.org/viewvc/llvm-project?rev=334091&view=rev
Log:
Fix MSVC 'implicit double to float truncation and 'not all control paths return a value' warnings. NFCI.

Modified:
    clang-tools-extra/trunk/clangd/Quality.cpp

Modified: clang-tools-extra/trunk/clangd/Quality.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Quality.cpp?rev=334091&r1=334090&r2=334091&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.cpp (original)
+++ clang-tools-extra/trunk/clangd/Quality.cpp Wed Jun  6 05:48:27 2018
@@ -90,6 +90,7 @@ categorize(const index::SymbolInfo &D) {
     case index::SymbolKind::Unknown:
       return SymbolQualitySignals::Unknown;
   }
+  llvm_unreachable("Unknown index::SymbolKind")
 }
 
 void SymbolQualitySignals::merge(const CodeCompletionResult &SemaCCResult) {
@@ -128,13 +129,13 @@ float SymbolQualitySignals::evaluate() c
     case Type:
     case Function:
     case Variable:
-      Score *= 1.1;
+      Score *= 1.1f;
       break;
     case Namespace:
-      Score *= 0.8;
+      Score *= 0.8f;
       break;
     case Macro:
-      Score *= 0.2;
+      Score *= 0.2f;
       break;
     case Unknown:
       break;




More information about the cfe-commits mailing list