Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/udlit-friend.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do compile { target c++11 } } |
2 | |
3 long double | |
4 operator"" _Hertz(long double); | |
5 | |
6 class Foo | |
7 { | |
8 public: | |
9 Foo() { } | |
10 | |
11 friend Foo operator"" _Bar(char); | |
12 | |
13 friend long double | |
14 operator"" _Hertz(long double omega) | |
15 { return omega / 6.28318530717958648; } | |
16 }; | |
17 | |
18 Foo | |
19 operator"" _Bar(char) | |
20 { return Foo(); } | |
21 | |
22 Foo f1 = operator"" _Bar('x'); | |
23 | |
24 Foo f2 = 'x'_Bar; | |
25 | |
26 long double fm1 = operator"" _Hertz(552.92L); | |
27 | |
28 long double fm2 = 552.92_Hertz; |