https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116866

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
A simple example:

#include <stdexcept>

int divide(int num, int denom) {
    if (denom == 0)
      std::invalid_argument ("division by zero"); // forgot "throw"
    return num / denom;
}

which compiles with -Wall with gcc 14.2 without warnings:
  https://godbolt.org/z/c6r5PM97W
constructing and desctructing the exception object, and then falling through to
the division.

Reply via email to