Author: Timm Baeder Date: 2026-03-16T12:41:20+01:00 New Revision: 5863fcbbe5b23b75db46af6bcd9fd65c0149a9c7
URL: https://github.com/llvm/llvm-project/commit/5863fcbbe5b23b75db46af6bcd9fd65c0149a9c7 DIFF: https://github.com/llvm/llvm-project/commit/5863fcbbe5b23b75db46af6bcd9fd65c0149a9c7.diff LOG: [clang][bytecode][NFC] Pre-commit a test case (#186773) Make sure we get the `expand()` during `computeOffsetForComparison()` right. Added: Modified: clang/test/AST/ByteCode/cxx20.cpp Removed: ################################################################################ diff --git a/clang/test/AST/ByteCode/cxx20.cpp b/clang/test/AST/ByteCode/cxx20.cpp index 139b6c873adce..9800fe01fcaf5 100644 --- a/clang/test/AST/ByteCode/cxx20.cpp +++ b/clang/test/AST/ByteCode/cxx20.cpp @@ -1304,3 +1304,30 @@ namespace PointerCmp { static_assert((void*)(&a.i + 1) != (void*)(&a.i[1])); // expected-error {{static assertion failed}} static_assert((void*)(&a.i[2] + 1) == (void*)(&a.i[3])); } + +namespace ExpandOnOPTEPointers { + + template <class _BidirectionalIterator> + constexpr void inplace_merge(_BidirectionalIterator __first, + _BidirectionalIterator __middle) { + + if (__first != __middle) + ++__first; + } + template <class> struct bidirectional_iterator { + int *it_; + constexpr void operator++() { ++it_; } + + friend constexpr bool operator!=(bidirectional_iterator x, + bidirectional_iterator y) { + return x.it_ != y.it_; + } + }; + constexpr bool test() { + int *ia = new int[0]; + inplace_merge(bidirectional_iterator<int *>(ia), bidirectional_iterator<int *>(ia + 0)); + delete[] ia; + return true; + } + static_assert(test()); +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
