Skip to content

Commit 8781a43

Browse files
authored
[NFC] Check for defined(__GNUC__) before use (#116076)
This silences some spurious warnings on Windows builds with clang-cl that `__GNUC__` is not defined if `-Wundef` is passed, which is the default in MLIR. These warnings make Windows builds of LLVM very noisy when MLIR is included.
1 parent 3f40ad7 commit 8781a43

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/ADT/iterator_range.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class iterator_range {
4343
IteratorT begin_iterator, end_iterator;
4444

4545
public:
46-
#if __GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4)
46+
#if defined(__GNUC__) && \
47+
(__GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4))
4748
// Be careful no to break gcc-7 and gcc-8 < 8.4 on the mlir target.
4849
// See https://github.com/llvm/llvm-project/issues/63843
4950
template <typename Container>

0 commit comments

Comments
 (0)