⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 array5.c

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 C
字号:
// { dg-do run }// Copyright (C) 2002 Free Software Foundation// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>// Incorrect construction and destruction of multi-dimensional// array of class.extern "C" void abort();extern "C" int printf(const char *, ...);int count;int num;struct A{	A()	{		if (count == num)			throw "";		count++;#ifdef PRINT		printf("ctor %p\n", static_cast<void *>(this));#endif	}	~A()	{		count--;#ifdef PRINT		printf("dtor %p\n", static_cast<void *>(this));#endif	}};struct Array{	A array[2][2][2];};int main(){	for (num = 0; num <= 8; ++num) {		count = 0;		try {			Array A;		}		catch (...) {		}		if (count != 0)			abort();	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -