summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/op5.C
blob: 69ef996d5c254e437b31a3fce35261ab99c59b22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Contributed by Dodji Seketeli <dseketel@redhat.com>
// Origin: PR c++/36407 
// { dg-do compile }

struct A
{
  A (const A&);
};

struct B
{
  operator A&();
};

void
foo (const B& b)
{
  const A a = b; // { dg-error "conversion from 'const B' to non-scalar type 'const A' requested" }
}