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