]> https://gitweb.dealii.org/ - dealii.git/commit
Exceptions: Do not set verbose terminate handler 6776/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 15 Jun 2018 19:54:05 +0000 (14:54 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 15 Jun 2018 22:46:16 +0000 (17:46 -0500)
commit707559181f057ff97fb78aa9101ed83ada0d9c7c
tree2940dceed9223a7582d88f2df9c4387aeff56a59
parent254e876aea6506346a14104a561b33969253fbce
Exceptions: Do not set verbose terminate handler

All of this is entirely redundant nowadays. libstdc++ defaults to
setting the verbose terminate handler since (almost) forever. So all we
end up doing is setting something that is already the default.

Remove it.

Rationale:

 - libstdc++ (gcc) switched to __gnu_cxx::__verbose_terminate_handler a
   long time ago [1].

 - libc++ (clang) has its own verbose terminate handler. And above code
   snippet never worked there [2]:

Example:

```

struct my_exception : public std::runtime_error {
  my_exception() : std::runtime_error("Nope, not with me") {}
};

int main() { throw my_exception(); }
```

libstdc++:
terminate called after throwing an instance of 'my_exception'
  what():  Nope, not with me
zsh: abort (core dumped)  ./a.out

libc++:
terminating with uncaught exception of type my_exception: Nope, not with me

[1] https://gcc.gnu.org/onlinedocs/libstdc++/manual/termination.html

[2] The DEAL_II_HAVE_VERBOSE_TERMINATE check fails for libc++ because
    (of course) no __gnu_cxx:: namespace is available...
cmake/checks/check_02_compiler_features.cmake
include/deal.II/base/config.h.in
source/base/exceptions.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.