[llvm] [OpenMP] Fix ambiguous namespace lookup with delayed template parsing (PR #212720)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 02:03:01 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-openmp

Author: Harrison Hao (harrisonGPU)

<details>
<summary>Changes</summary>

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.

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


1 Files Affected:

- (modified) llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h (+1-1) 


``````````diff
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);
   });
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/212720


More information about the llvm-commits mailing list