view gcc/testsuite/g++.dg/cpp0x/initlist-ref-2267.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// CWG 2267
// { dg-do compile { target c++11 } }

struct A {} a; 
struct B { explicit B(const A&); }; 
B b1(a); // #1, ok 
const B &b2{a}; // { dg-error "" }
const B &b3(a); // { dg-error "" }

struct D { D(); }; 
struct C { explicit operator D(); } c; 
D d1(c); // ok 
const D &d2{c}; // { dg-error "" }
const D &d3(c); // { dg-error "" }