Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.old-deja/g++.jason/static1.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 // PRMS id: 6863 | |
3 | |
4 extern "C" int printf(const char *, ...); | |
5 extern "C" void abort(); | |
6 | |
7 enum ENUM {E1=0, E2 }; | |
8 int d; | |
9 | |
10 class AAA{ | |
11 public: | |
12 AAA() {a = new char[10];printf("constructor AAA() called\n");} | |
13 AAA(int) {printf("constructor AAA(int) called\n");} | |
14 ~AAA(){ printf("destructor ~AAA() called\n"); d = 1; } | |
15 operator int () { return 1;} | |
16 char *a; | |
17 int i; | |
18 }; | |
19 | |
20 struct sentinel { | |
21 ~sentinel () { if (d == 0) abort (); } | |
22 } s; | |
23 | |
24 /* forward decl here causes gcc not to execute ct and dt for arr1 */ | |
25 extern AAA arr1[]; | |
26 | |
27 AAA arr1[] = {(int)E1 }; | |
28 | |
29 int main() | |
30 { | |
31 return 0; | |
32 } |