Files
test/cpp/pod_constructor_optimization_for_array.cpp

38 lines
406 B
C++

#include <iostream>
#include <exception>
struct A
{
int a;
int b;
A()
{
std::cout << "A::A()" << std::endl;
}
};
int main ( void )
{try{
A a[4];
return 0;
}
catch ( const std::exception& e )
{
std::cerr << std::endl
<< "std::exception(\"" << e.what() << "\")." << std::endl;
return 2;
}
catch ( ... )
{
std::cerr << std::endl
<< "unknown exception." << std::endl;
return 1;
}}