clang/test/AST/static-compound-literals.cpp
raw| 1 | // Test that we can successfully compile this code, especially under ASAN. |
| 2 | // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s |
| 3 | // expected-no-diagnostics |
| 4 | struct Foo { |
| 5 | Foo* f; |
| 6 | operator bool() const { return true; } |
| 7 | }; |
| 8 | constexpr Foo f((Foo[]){}); |
| 9 | int foo() { |
| 10 | if (Foo(*f.f)) return 1; |
| 11 | return 0; |
| 12 | } |