mirror of
https://github.com/AdaCore/gpr.git
synced 2026-02-12 12:58:39 -08:00
Adjust the project files to properly install them in share/doc For eng/gpr/gpr-issues#548
37 lines
541 B
C++
37 lines
541 B
C++
#include <iostream>
|
|
#include "cpp_routine.h"
|
|
|
|
using namespace std;
|
|
|
|
void recurse_then_raise (int n);
|
|
|
|
void cpp_routine ()
|
|
{
|
|
cout << " In cpp_routine" << endl;
|
|
|
|
cout << " Calling recurse_then_raise" << endl;
|
|
|
|
try
|
|
{
|
|
recurse_then_raise (10);
|
|
}
|
|
catch (int except)
|
|
{
|
|
cout << " caught an exception: " << except << endl;
|
|
}
|
|
|
|
cout << " returning from cpp_routine." << endl;
|
|
}
|
|
|
|
void recurse_then_raise (int n)
|
|
{
|
|
if (n > 0)
|
|
{
|
|
recurse_then_raise (n - 1);
|
|
}
|
|
else
|
|
{
|
|
throw 1;
|
|
}
|
|
}
|