aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/other/synth1.C
blob: 5829c6c78620aede867d84f4efd0b9c5f6d8e3b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 17 Dec 2004 <nathan@codesourcery.com>

// PR 18975: Rejects legal
// Origin:   Wolfgang Roehrl <wolfgang.roehrl@de.gi-de.com>

struct PTR
{
  PTR ();
  PTR (PTR&);
  PTR& operator= (PTR&);
  
private:
  PTR (const PTR&);
  PTR& operator= (const PTR&);
};


struct XYZ
{
  XYZ (PTR& p) : ptr(p) {}

  mutable PTR ptr;
};


XYZ f1 ();


XYZ f2 (void) { return f1(); }
void f3 (XYZ& dst, const XYZ& src) { dst = src; }