Debian Codegraph @

libstdc++-v3/testsuite/18_support/new_aligned_warn.cc

raw
1 // { dg-options "-Wattributes" }
2 // { dg-do compile { target c++17 } }
3
4 #include <new>
5
6 int main()
7 {
8 // PR c++/86878 has a patch to make these warn.
9 (void) operator new(1, std::align_val_t(3)); // { dg-warning "power of two" "" { xfail *-*-* } }
10 (void) operator new[](1, std::align_val_t(10)); // { dg-warning "power of two" "" { xfail *-*-* } }
11 (void) operator new(1, std::align_val_t(0), std::nothrow_t()); // { dg-warning "power of two" "" { xfail *-*-* } }
12 (void) operator new[](1, std::align_val_t(-1), std::nothrow_t()); // { dg-warning "power of two" "" { xfail *-*-* } }
13 }