---
name: "__gnu_cxx::forced_error"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::forced_error"
---

# \_\_gnu\_cxx::forced\_error(3)

Thrown by utilities for testing exception safety.

## NAME

\_\_gnu\_cxx::forced\_error - Thrown by utilities for testing exception safety.

## SYNOPSIS

\#include \<throw\_allocator.h\>

Inherits **std::exception**.

### Public Member Functions

virtual constexpr const char \* **what** () const noexcept\

## Detailed Description

Thrown by utilities for testing exception safety.

## Member Function Documentation

### virtual constexpr const char \* std::exception::what () const \[inline\], \[constexpr\], \[virtual\], \[noexcept\], \[inherited\]

Returns a C-style character string describing the general cause of the current error.

Reimplemented in **std::bad\_alloc**, **std::bad\_cast**, **std::bad\_exception**, **std::bad\_function\_call**, **std::bad\_typeid**, **std::bad\_weak\_ptr**, **std::experimental::filesystem::v1::filesystem\_error**, **std::experimental::fundamentals\_v1::bad\_any\_cast**, **std::filesystem::filesystem\_error**, **std::future\_error**, **std::ios\_base::failure**, **std::logic\_error**, and **std::runtime\_error**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
