[llvm] [NFC] Check for defined(__GNUC__) before use (PR #116076)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 08:08:59 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: David Truby (DavidTruby)
<details>
<summary>Changes</summary>
This silences some spurious warnings on Windows builds that __GNUC__ is
not defined. These warnings make Windows builds very noisy.
---
Full diff: https://github.com/llvm/llvm-project/pull/116076.diff
1 Files Affected:
- (modified) llvm/include/llvm/ADT/iterator_range.h (+2-1)
``````````diff
diff --git a/llvm/include/llvm/ADT/iterator_range.h b/llvm/include/llvm/ADT/iterator_range.h
index 6c66def0fcd77b..8e9b22f2d4dfa7 100644
--- a/llvm/include/llvm/ADT/iterator_range.h
+++ b/llvm/include/llvm/ADT/iterator_range.h
@@ -43,7 +43,8 @@ class iterator_range {
IteratorT begin_iterator, end_iterator;
public:
-#if __GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4)
+#if defined(__GNUC__) && \
+ (__GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4))
// Be careful no to break gcc-7 and gcc-8 < 8.4 on the mlir target.
// See https://github.com/llvm/llvm-project/issues/63843
template <typename Container>
``````````
</details>
https://github.com/llvm/llvm-project/pull/116076
More information about the llvm-commits
mailing list