remove-trailing-space-version
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 31 Oct 2020 13:13:25 +0000 (13:13 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 31 Oct 2020 13:13:25 +0000 (13:13 +0000)
===================================================================

Gbp-Pq: Name remove-trailing-space-version.diff

clang/lib/Basic/Version.cpp

index e1b9ccf2e4de741cfeaa30f3b0818c80acaa5c5b..e05a57e97325ba06387b8748c3592101e3d8e1c7 100644 (file)
@@ -125,8 +125,12 @@ std::string getClangToolFullVersion(StringRef ToolName) {
 #ifdef CLANG_VENDOR
   OS << CLANG_VENDOR;
 #endif
-  OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION " "
-     << getClangFullRepositoryVersion();
+  OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION;
+
+  std::string repo = getClangFullRepositoryVersion();
+  if (!repo.empty()) {
+    OS << " " << repo;
+  }
 
   return OS.str();
 }
@@ -139,7 +143,13 @@ std::string getClangFullCPPVersion() {
 #ifdef CLANG_VENDOR
   OS << CLANG_VENDOR;
 #endif
-  OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion();
+  OS << "Clang " CLANG_VERSION_STRING;
+
+  std::string repo = getClangFullRepositoryVersion();
+  if (!repo.empty()) {
+    OS << " " << repo;
+  }
+
   return OS.str();
 }