blob: 1d65abbcc9febbc25d6425ce25938717c45a8b92 [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
John McCall6dbba4f2011-10-11 23:14:30 +000011void f(); // expected-note{{possible target for call}}
12void f(int); // expected-note{{possible target for call}}
Douglas Gregor9ba6af82010-05-23 19:43:23 +000013void g() {
John McCall6dbba4f2011-10-11 23:14:30 +000014 sizeof(&f); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
Douglas Gregor9ba6af82010-05-23 19:43:23 +000015}
Douglas Gregor4f0845e2011-06-22 23:21:00 +000016
John McCall6dbba4f2011-10-11 23:14:30 +000017template<typename T> void f_template(); // expected-note{{possible target for call}}
18template<typename T> void f_template(T*); // expected-note{{possible target for call}}
Douglas Gregor4f0845e2011-06-22 23:21:00 +000019void rdar9659191() {
John McCall6dbba4f2011-10-11 23:14:30 +000020 (void)alignof(f_template<int>); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
Douglas Gregor4f0845e2011-06-22 23:21:00 +000021}