Commit 05dc519
authored
[IR] Make succ_iterator compliant with C++20 (#188601)
GCC 15.2 enforces the `DefaultConstructible` requirement for
`std::reverse_iterator<llvm::succ_iterator>` causing LLVM to fail to
build with C++20 (see https://discourse.llvm.org/t/suspicious-usages-of-std-reverse-iterator-and-associated-llvm-build-failures-with-gcc-15-2-1/89426, issue #182417).
```
$ cmake -G Ninja -S llvm -B llvm/build \
-DCMAKE_INSTALL_PREFIX=$(mktemp -d) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DLLVM_ENABLE_PROJECTS="clang;" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_USE_LINKER=lld \
-DCMAKE_CXX_STANDARD=20 \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_PARALLEL_LINK_JOBS=4
$ ninja -C llvm/build bin/llvm-lib
...
/usr/include/c++/15/bits/stl_iterator.h:182:7: error: no matching function for call to ‘llvm::Instruction::succ_iterator::succ_iterator()’
182 | _GLIBCXX_NOEXCEPT_IF(noexcept(_Iterator()))
...
```
Adding a default constructor fixes this error.
Fixes #182417.1 parent 180ae2f commit 05dc519
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
0 commit comments