// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
;
typedef X foo_t;
foo_t *ptr;
char c1 = ptr; // expected-error{{'foo_t *' (aka 'X *')}}
const foo_t &ref = ;
char c2 = ref; // expected-error{{'const foo_t' (aka 'const X')}}
// deduced auto should not produce an aka.
auto aut = ;
char c3 = aut; // expected-error{{from 'X' to 'char'}}
// There are two classes named Foo::foo here. Make sure the message gives
// a way to them apart.
void
;
typedef void ;
void // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument}}
void
;
int a1 = A<decltype>; // expected-error{{no viable conversion from 'A<decltype(1 + 2)>' (aka 'A<int>') to 'int'}}
int a2 = A<A<decltype>>; // expected-error{{no viable conversion from 'A<A<decltype(1 + 2)>>' (aka 'A<A<int>>') to 'int'}}
int a3 = A<__typeof>; // expected-error{{no viable conversion from 'A<typeof (1 + 2)>' (aka 'A<int>') to 'int'}}
int a4 = A<A<__typeof>>; // expected-error{{no viable conversion from 'A<A<typeof (1 + 2)>>' (aka 'A<A<int>>') to 'int'}}
using B = A<decltype>;
int a5 = ; // expected-error{{no viable conversion from 'B' (aka 'A<int>') to 'int'}}
decltype = 0; // expected-error{{non-const lvalue reference to type 'decltype(void()) ()' (aka 'void ()') cannot bind to a temporary of type 'int'}}
decltype = 0; // expected-error{{non-const lvalue reference to type 'decltype(void()) (int)' (aka 'void (int)') cannot bind to a temporary of type 'int'}}
void = 0; // expected-error{{non-const lvalue reference to type 'void (decltype(1 + 2))' (aka 'void (int)') cannot bind to a temporary of type 'int'}}
decltype = 0; // expected-error{{non-const lvalue reference to type 'decltype(1 + 2) (double, decltype(1 + 2))' (aka 'int (double, int)') cannot bind to a temporary of type 'int'}}
auto -> = 0; // expected-error{{non-const lvalue reference to type 'auto () -> decltype(1 + 2)' (aka 'auto () -> int') cannot bind to a temporary of type 'int'}}
using C = decltype;;
C a6;
extern C a8;
int a9 = a6; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'C[10]' (aka 'int[10]')}}
int a10 = a8; // expected-error{{cannot initialize a variable of type 'int' with an lvalue of type 'C[]' (aka 'int[]')}}