aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-friend.C
blob: 54d7b7a1f11130ea25f5e5358fc16bd35a909e90 (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
// { dg-do compile { target c++11 } }

long double
operator"" _Hertz(long double);

class Foo
{
public:
  Foo() { }

  friend Foo operator"" _Bar(char);

  friend long double
  operator"" _Hertz(long double omega)
  { return omega / 6.28318530717958648; }
};

Foo
operator"" _Bar(char)
{ return Foo(); }

Foo f1 = operator"" _Bar('x');

Foo f2 = 'x'_Bar;

long double fm1 = operator"" _Hertz(552.92L);

long double fm2 = 552.92_Hertz;