-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support exceptions with virtual inheritance, by letting libcxxabi adj…
…ust the pointer as an out param; fixes #2531; 1.21.9
- Loading branch information
Showing
6 changed files
with
57 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
1.21.8 | ||
1.21.9 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <iostream> | ||
#include <stdexcept> | ||
|
||
using std::cout; | ||
using std::endl; | ||
|
||
struct my_exception : public virtual std::runtime_error { | ||
// To allow this to be thrown directly in the tests below. | ||
explicit my_exception(const std::string &what) | ||
: std::runtime_error(what) | ||
{} | ||
|
||
protected: | ||
my_exception() | ||
// This won't be called because of virtual inheritance. | ||
: std::runtime_error("::my_exception") | ||
{} | ||
}; | ||
|
||
int main(const int argc, const char * const * const argv) { | ||
try { | ||
cout << "Throwing ::my_exception" << endl; | ||
throw ::my_exception("my_what"); | ||
} catch(const std::runtime_error &ex) { | ||
cout << "Caught std::runtime_error: " << ex.what() << endl; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Throwing ::my_exception | ||
Caught std::runtime_error: my_what |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters