| 1 |
/* PR c++/94510 - nullptr_t implicitly cast to zero twice in std::array |
| 2 |
{ dg-do compile } */ |
| 3 |
|
| 4 |
int ia1[2] = { (void*)0 }; // { dg-error "invalid conversion from 'void\\\*'" } |
| 5 |
int ia2[2] = { (void*)0, 0 }; // { dg-error "invalid conversion from 'void\\\*'" } |
| 6 |
int ia3[] = { (void*)0, 0 }; // { dg-error "invalid conversion from 'void\\\*'" } |
| 7 |
|
| 8 |
int ia4[2] = { __null }; // { dg-warning "\\\[-Wconversion-null" } |
| 9 |
int ia5[2] = { __null, 0 }; // { dg-warning "\\\[-Wconversion-null" } |
| 10 |
int ia6[] = { __null, 0 }; // { dg-warning "\\\[-Wconversion-null" } |
| 11 |
|
| 12 |
|
| 13 |
const char ca1[2] = { (char*)0, 0 }; // { dg-error "invalid conversion from 'char\\\*'" } |
| 14 |
|
| 15 |
const char ca2[2] = { __null, 0 }; // { dg-warning "\\\[-Wconversion-null" } |
| 16 |
|
| 17 |
|
| 18 |
typedef void Func (); |
| 19 |
const char ca6[2] = { (Func*)0, 0 }; // { dg-error "invalid conversion from 'void \\\(\\\*\\\)\\\(\\\)' to 'char'" } |
| 20 |
|
| 21 |
struct S; |
| 22 |
typedef int S::*MemPtr; |
| 23 |
typedef int (S::*MemFuncPtr)(); |
| 24 |
|
| 25 |
const char ca4[2] = { (MemPtr)0, 0 }; // { dg-error "cannot convert 'MemPtr' " } |
| 26 |
const char ca5[2] = { (MemFuncPtr)0, 0 }; // { dg-error "cannot convert 'int \\\(S::\\\*\\\)\\\(\\\)' " } |