1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-unknown-unknown -verify %s -std=c++11 -Wno-unused
11 struct B
{ // expected-note 3 {{candidate constructor (the implicit copy constructor) not viable}} \
12 expected
-note
3 {{candidate
constructor (the implicit move constructor
) not viable
}}
13 B(A
); // expected-note 3 {{candidate constructor not viable}}
17 B(10); // expected-error {{no matching conversion for functional-style cast from 'int' to 'B'}}
18 (B
)10; // expected-error {{no matching conversion for C-style cast from 'int' to 'B'}}
19 static_cast<B
>(10); // expected-error {{no matching conversion for static_cast from 'int' to 'B'}}
28 X0
<T
> make_X0(const T
&Val
) {
33 const char array
[2] = { 'a', 'b' };
40 template <int> float* &f0(); // expected-note{{candidate}}
41 template <unsigned> float* &f0(); // expected-note{{candidate}}
44 static_cast<float*>(f0
<0>()); // expected-error{{ambiguous}}
48 void *intToPointer1(short s
) {
49 return (void*)s
; // expected-warning{{cast to 'void *' from smaller integer type 'short'}}
52 void *intToPointer2(short s
) {
53 return reinterpret_cast<void*>(s
);
56 void *intToPointer3(bool b
) {
60 void *intToPointer4() {
61 return (void*)(3 + 7);
64 void *intToPointer5(long l
) {
68 struct AmbiguousCast
{
69 operator int(); // expected-note {{candidate function}}
70 operator unsigned int(); // expected-note {{candidate function}}
72 long long AmbiguousCastFunc(AmbiguousCast
& a
) {
73 return static_cast<long long>(a
); // expected-error {{ambiguous conversion for static_cast from 'AmbiguousCast' to 'long long'}}
77 void f(int (*__pf
)());
79 f(reinterpret_cast<int>(0.0f
)); // expected-error {{reinterpret_cast from 'float' to 'int' is not allowed}}