Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Oct 3, 2025

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/161778.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Support/ScopedPrinter.h (+3-7)
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index a08cc8fd31fd2..ce125f60fd44c 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -454,14 +454,10 @@ class LLVM_ABI ScopedPrinter {
   virtual raw_ostream &getOStream() { return OS; }
 
 private:
-  template <typename T> void printVersionInternal(T Value) {
+  template <typename T, typename... TArgs>
+  void printVersionInternal(T Value, TArgs... Args) {
     getOStream() << Value;
-  }
-
-  template <typename S, typename T, typename... TArgs>
-  void printVersionInternal(S Value, T Value2, TArgs... Args) {
-    getOStream() << Value << ".";
-    printVersionInternal(Value2, Args...);
+    ((getOStream() << '.' << Args), ...);
   }
 
   static bool flagName(const FlagEntry &LHS, const FlagEntry &RHS) {

@kazutakahirata kazutakahirata merged commit 8af44b0 into llvm:main Oct 4, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251002_Support_ScopedPrinter branch October 4, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants