[flang-commits] [flang] [Flang] Allow using common::visit with Clang (PR #90137)

Alexander Shaposhnikov via flang-commits flang-commits at lists.llvm.org
Thu Apr 25 15:26:35 PDT 2024


https://github.com/alexander-shaposhnikov created https://github.com/llvm/llvm-project/pull/90137

Allow using common::visit with Clang.

Test plan: ninja check-all

>From e34eef6b215a028fd655a773d2cb183fa4198df6 Mon Sep 17 00:00:00 2001
From: Alexander Shaposhnikov <ashaposhnikov at google.com>
Date: Thu, 25 Apr 2024 22:24:16 +0000
Subject: [PATCH] [Flang] Allow using common::visit with Clang

---
 flang/include/flang/Common/visit.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/include/flang/Common/visit.h b/flang/include/flang/Common/visit.h
index 4d0897301e01db..ae1a2c3785f104 100644
--- a/flang/include/flang/Common/visit.h
+++ b/flang/include/flang/Common/visit.h
@@ -82,7 +82,7 @@ inline RT_API_ATTRS auto visit(VISITOR &&visitor, VARIANT &&...u)
 // Some versions of clang have bugs that cause compilation to hang
 // on these templates.  MSVC and older GCC versions may work but are
 // not well tested.  So enable only for GCC 9 and better.
-#if __GNUC__ < 9
+#if __GNUC__ < 9 && !defined(__clang__)
 #define FLANG_USE_STD_VISIT
 #endif
 



More information about the flang-commits mailing list