blob: 945129c26a4c86d76bb819f01dd2f091e9fb2529 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
Sebastian Redl5d484e82009-11-23 17:18:46 +00002
3struct s0; // expected-note {{forward declaration}}
4char ar[sizeof(s0&)]; // expected-error {{invalid application of 'sizeof' to an incomplete type}}
5void test() {
6 char &r = ar[0];
7 static_assert(alignof(r) == 1, "bad alignment");
8 static_assert(sizeof(r) == 1, "bad size");
9}
Douglas Gregor9ba6af82010-05-23 19:43:23 +000010
11void f();
12void f(int);
13void g() {
John McCall2a984ca2010-10-12 00:20:44 +000014 sizeof(&f); // expected-error{{cannot determine the type of an overloaded function}}
Douglas Gregor9ba6af82010-05-23 19:43:23 +000015}