2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
|
2009-11-24 01:18:46 +08:00
|
|
|
|
|
|
|
struct s0; // expected-note {{forward declaration}}
|
|
|
|
char ar[sizeof(s0&)]; // expected-error {{invalid application of 'sizeof' to an incomplete type}}
|
|
|
|
void test() {
|
|
|
|
char &r = ar[0];
|
|
|
|
static_assert(alignof(r) == 1, "bad alignment");
|
|
|
|
static_assert(sizeof(r) == 1, "bad size");
|
|
|
|
}
|
2010-05-24 03:43:23 +08:00
|
|
|
|
2011-10-12 07:14:30 +08:00
|
|
|
void f(); // expected-note{{possible target for call}}
|
|
|
|
void f(int); // expected-note{{possible target for call}}
|
2010-05-24 03:43:23 +08:00
|
|
|
void g() {
|
2011-10-14 02:10:35 +08:00
|
|
|
sizeof(&f); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it with no arguments?}} \
|
|
|
|
// expected-warning{{expression result unused}}
|
2010-05-24 03:43:23 +08:00
|
|
|
}
|
2011-06-23 07:21:00 +08:00
|
|
|
|
2011-10-12 07:14:30 +08:00
|
|
|
template<typename T> void f_template(); // expected-note{{possible target for call}}
|
|
|
|
template<typename T> void f_template(T*); // expected-note{{possible target for call}}
|
2011-06-23 07:21:00 +08:00
|
|
|
void rdar9659191() {
|
2011-10-12 07:14:30 +08:00
|
|
|
(void)alignof(f_template<int>); // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}
|
2011-06-23 07:21:00 +08:00
|
|
|
}
|