[llvm] 421d2e8 - [OpenMP] Fix ambiguous namespace lookup with delayed template parsing (#212720)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 09:04:30 PDT 2026
Author: Harrison Hao
Date: 2026-07-30T00:04:25+08:00
New Revision: 421d2e88e4f08f39a4bd48b9591c62d1145ec0ac
URL: https://github.com/llvm/llvm-project/commit/421d2e88e4f08f39a4bd48b9591c62d1145ec0ac
DIFF: https://github.com/llvm/llvm-project/commit/421d2e88e4f08f39a4bd48b9591c62d1145ec0ac.diff
LOG: [OpenMP] Fix ambiguous namespace lookup with delayed template parsing (#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.
Added:
Modified:
llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
Removed:
################################################################################
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