[llvm] [OpenMP] Fix ambiguous namespace lookup with delayed template parsing (PR #212720)
Harrison Hao via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 02:02:12 PDT 2026
https://github.com/harrisonGPU created https://github.com/llvm/llvm-project/pull/212720
Running `check-llvm` on Windows fails while compiling LLVMFrontendTests
with the following error:
error: reference to 'detail' is ambiguous
Clang enables delayed template parsing by default when targeting the
MSVC ABI on Windows. When ConstructDecompositionT is instantiated after
a using-directive for llvm::omp, both ::detail and llvm::omp::detail are
visible, making detail::find_unique ambiguous.
Explicitly qualify find_unique with the global namespace. This fixes
check-llvm on Windows and other environments using
-fdelayed-template-parsing, without changing behavior.
>From 8cf39a939251a07b93f2cf0721ed3aa1a34ce68e Mon Sep 17 00:00:00 2001
From: Harrison Hao <tsworld1314 at gmail.com>
Date: Wed, 29 Jul 2026 16:59:03 +0800
Subject: [PATCH] [OpenMP] Fix ambiguous namespace lookup with delayed template
parsing
---
llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
index bf812860a2543..d252f222f73d0 100644
--- a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
+++ b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
@@ -398,7 +398,7 @@ ConstructDecompositionT<C, H>::addClauseSymsToMap(U &&item,
// anything and return false, otherwise return true.
template <typename C, typename H>
bool ConstructDecompositionT<C, H>::applyToUnique(const ClauseTy *input) {
- auto unique = detail::find_unique(leafs, [=](const auto &leaf) {
+ auto unique = ::detail::find_unique(leafs, [=](const auto &leaf) {
return llvm::omp::isAllowedClauseForDirective(leaf.id, input->id, version);
});
More information about the llvm-commits
mailing list