diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /clang/test/AST/ByteCode/if.cpp | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'clang/test/AST/ByteCode/if.cpp')
| -rw-r--r-- | clang/test/AST/ByteCode/if.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/if.cpp b/clang/test/AST/ByteCode/if.cpp index 540cb76fbaac..c48b2b8d378c 100644 --- a/clang/test/AST/ByteCode/if.cpp +++ b/clang/test/AST/ByteCode/if.cpp @@ -76,3 +76,30 @@ namespace IfScope { } static_assert(foo() == 13, ""); } + +namespace IfScope2 { + struct __bit_iterator { + unsigned __ctz_; + }; + constexpr void __fill_n_bool(__bit_iterator) {} + + constexpr void fill_n(__bit_iterator __first) { + if (false) + __fill_n_bool(__first); + else + __fill_n_bool(__first); + } + + struct bitset{ + constexpr void reset() { + auto m = __bit_iterator(8); + fill_n(m); + } + }; + consteval bool foo() { + bitset v; + v.reset(); + return true; + } + static_assert(foo()); +} |
