[clang] [NFC] Fix ctad warning in CompilerInstance (PR #181186)

Jinsong Ji via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 12 09:15:10 PST 2026


https://github.com/jsji created https://github.com/llvm/llvm-project/pull/181186

Fix warning:

'std::vector' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
 2030 |       std::vector Worklist{Module};


>From 5d1f68eec277633506a87d19e6642ee0d1f9ed8e Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Thu, 12 Feb 2026 09:05:36 -0800
Subject: [PATCH] [NFC] Fix ctad warning in CompilerInstance

Fix warning:

'std::vector' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
 2030 |       std::vector Worklist{Module};
---
 clang/lib/Frontend/CompilerInstance.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index cb3e6fb9688a9..436e6e70eec73 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1998,7 +1998,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
         PPCb->moduleLoadSkipped(Module);
       // Mark the module and its submodules as if they were loaded from a PCM.
       // This prevents emission of the "missing submodule" diagnostic below.
-      std::vector Worklist{Module};
+      std::vector<decltype(Module)> Worklist{Module};
       while (!Worklist.empty()) {
         auto *M = Worklist.back();
         Worklist.pop_back();



More information about the cfe-commits mailing list