view gcc/testsuite/g++.dg/diagnostic/array-init1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR c++/93710 - poor diagnostic for array initializer.

struct A { A (int); A (char*); int i; };

int x;

A a1[] = {
  0L, // { dg-error "3:conversion from .long int. to .A. is ambiguous" }
  &x, // { dg-error "3:invalid conversion from .int\\*. to .int." }
  __builtin_offsetof (A, i) // { dg-error "23:conversion from .\(long \)?unsigned int. to .A. is ambiguous" }
};