Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s |
Sebastian Redl | 5d484e8 | 2009-11-23 17:18:46 +0000 | [diff] [blame] | 2 | |
| 3 | struct s0; // expected-note {{forward declaration}} |
| 4 | char ar[sizeof(s0&)]; // expected-error {{invalid application of 'sizeof' to an incomplete type}} |
| 5 | void test() { |
| 6 | char &r = ar[0]; |
| 7 | static_assert(alignof(r) == 1, "bad alignment"); |
| 8 | static_assert(sizeof(r) == 1, "bad size"); |
| 9 | } |
Douglas Gregor | 9ba6af8 | 2010-05-23 19:43:23 +0000 | [diff] [blame] | 10 | |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 11 | void f(); // expected-note{{candidate function}} |
| 12 | void f(int); // expected-note{{candidate function}} |
Douglas Gregor | 9ba6af8 | 2010-05-23 19:43:23 +0000 | [diff] [blame] | 13 | void g() { |
Douglas Gregor | db2eae6 | 2011-03-16 19:16:25 +0000 | [diff] [blame^] | 14 | sizeof(&f); // expected-error{{cannot resolve overloaded function 'f' from context}} |
Douglas Gregor | 9ba6af8 | 2010-05-23 19:43:23 +0000 | [diff] [blame] | 15 | } |