Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations4.C

raw
1 // PR c++/115476
2 // { dg-do compile { target c++11 } }
3
4 struct X;
5 static_assert(__has_unique_object_representations(X), ""); // { dg-error "invalid use of incomplete type" }
6 static_assert(__has_unique_object_representations(X[]), ""); // { dg-error "invalid use of incomplete type" }
7 static_assert(__has_unique_object_representations(X[1]), ""); // { dg-error "invalid use of incomplete type" }
8 static_assert(__has_unique_object_representations(X[][1]), ""); // { dg-error "invalid use of incomplete type" }
9
10 struct X {
11 int x;
12 };
13 static_assert(__has_unique_object_representations(X), "");
14 static_assert(__has_unique_object_representations(X[]), "");
15 static_assert(__has_unique_object_representations(X[1]), "");
16 static_assert(__has_unique_object_representations(X[][1]), "");