comparison gcc/testsuite/g++.dg/cpp1y/builtin_FUNCTION.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 // { dg-do run }
2
3 #include <string.h>
4
5 const char *ct, *dt, *cv;
6
7 struct KLASS
8 {
9 KLASS () ;
10 ~KLASS ();
11 operator int ();
12 };
13
14 KLASS::KLASS()
15 {
16 ct = __builtin_FUNCTION ();
17 }
18
19 KLASS::~KLASS ()
20 {
21 dt = __builtin_FUNCTION ();
22 }
23
24 KLASS::operator int ()
25 {
26 cv = __builtin_FUNCTION ();
27 return 0;
28 }
29
30 int main ()
31 {
32 int q = int (KLASS ());
33
34 if (strcmp (ct, "KLASS"))
35 return 1;
36 if (strcmp (dt, "~KLASS"))
37 return 2;
38 if (strcmp (cv, "operator int"))
39 return 3;
40
41 return 0;
42 }