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 ] ;
2013-01-29 18:18:18 +08:00
static_assert ( alignof ( r ) = = 1 , " bad alignment " ) ; // expected-warning {{GNU extension}}
static_assert ( alignof ( char & ) = = 1 , " bad alignment " ) ;
2009-11-24 01:18:46 +08:00
static_assert ( sizeof ( r ) = = 1 , " bad size " ) ;
2013-01-29 18:18:18 +08:00
static_assert ( sizeof ( char & ) = = 1 , " bad size " ) ;
2009-11-24 01:18:46 +08:00
}
2010-05-24 03:43:23 +08:00
2013-08-14 06:26:42 +08:00
int f ( ) ; // expected-note{{possible target for call}}
int 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 ( ) {
2013-01-29 18:18:18 +08:00
( void ) alignof ( f_template < int > ) ; // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}} expected-warning {{GNU extension}}
2011-06-23 07:21:00 +08:00
}