Skip to content

Commit c57be05

Browse files
committed
[llvm] do not define LLVM_TEMPLATE_ABI for GCC builds
1 parent 7aeebfd commit c57be05

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/include/llvm/Support/Compiler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@
200200
#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
201201
defined(__MVS__)
202202
#define LLVM_ABI __attribute__((visibility("default")))
203+
#if defined(__GNUC__) && !defined(__clang__)
204+
// GCC produces warnings on visibility attributes applied to templates.
205+
#define LLVM_TEMPLATE_ABI
206+
#else
203207
#define LLVM_TEMPLATE_ABI __attribute__((visibility("default")))
208+
#endif
204209
#define LLVM_EXPORT_TEMPLATE
205210
#define LLVM_ABI_EXPORT __attribute__((visibility("default")))
206211
#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__)

0 commit comments

Comments
 (0)