[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Exceptions not caught in gcc-4.3.0 program
From: |
Visa Inquirer |
Subject: |
Exceptions not caught in gcc-4.3.0 program |
Date: |
Tue, 8 Apr 2008 12:21:28 -0700 (PDT) |
User-agent: |
G2/1.0 |
I compile the source exc.C:
--- begin source ---
#include <iostream>
#include <string>
using namespace std;
void fun();
int main() {
try {
throw string("Hi there!");
}
catch (string s) {
cout << "Catched exception \"" << s << "\"\n";
}
}
--- end source ---
With the command:
/usr/local/gcc-4.3.0/bin/g++ -ansi -Wall -o exc exc.C
And I get an output:
terminate called after throwing an instance of 'std::string'
terminate called recursively
Abort trap: 6
Exception is never caught.
What is wrong?
- Exceptions not caught in gcc-4.3.0 program,
Visa Inquirer <=