[llvm] [llubi][NFC] Fix build with old GCC (PR #195327)

Nick Sarnie via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 11:55:52 PDT 2026


https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/195327

Using old GCC (7.5 in this case), we get a compile error about not being able to deduce the template paramerter:


```
/llvm/llvm/tools/llubi/lib/Interpreter.cpp:770:14: error: no viable constructor or deduction guide for deduction of template arguments of 'std::vector'
  770 |       return std::vector(Vec.begin() + Offset, Vec.begin() + Offset + DstSize);
```

Just specify the element type.

>From fe5cdce6b09d39e82817c24b47a3275d05c27bbc Mon Sep 17 00:00:00 2001
From: Nick Sarnie <nick.sarnie at intel.com>
Date: Fri, 1 May 2026 11:53:23 -0700
Subject: [PATCH] [llubi][NFC] Fix build with old GCC

Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
---
 llvm/tools/llubi/lib/Interpreter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/tools/llubi/lib/Interpreter.cpp b/llvm/tools/llubi/lib/Interpreter.cpp
index 1f68051c617a0..e40d35a8bb315 100644
--- a/llvm/tools/llubi/lib/Interpreter.cpp
+++ b/llvm/tools/llubi/lib/Interpreter.cpp
@@ -786,7 +786,7 @@ class InstExecutor : public InstVisitor<InstExecutor, void>,
       const uint64_t Offset = Chunk * EVL;
       if (Offset > Vec.size() || EVL > Vec.size() - Offset)
         return AnyValue::poison();
-      return std::vector(Vec.begin() + Offset, Vec.begin() + Offset + EVL);
+      return std::vector<AnyValue>(Vec.begin() + Offset, Vec.begin() + Offset + EVL);
     }
     case Intrinsic::vector_reverse: {
       auto Vec = Args[0].asAggregate();



More information about the llvm-commits mailing list