---
title: A conservative fix for constexpr uncaught_exceptions() and current_exception()
document: P3842R1
date: 2026-03-25
audience: LWG
reply-to:
  - "Ville Voutilainen <ville.voutilainen@gmail.com>"
paper-type: proposal
---

---

# A conservative fix for constexpr uncaught_exceptions() and current_exception()

## Abstract

The papers [P3818](https://open-std.org/JTC1/SC22/WG21/docs/papers/2025/p3818r1.html) and [P3820](https://open-std.org/JTC1/SC22/WG21/docs/papers/2025/p3820r1.html) explain the background of the problem we have making uncaught_exceptions() and current_exception(). In short, having those function constexpr is a breaking change in some cases.

Due to timing and lateness thereof, it's deemed prudent to just roll back adding constexpr to those functions, and figure out a solution in C++29 for allowing those functionalities in constant expression evaluation. That was the outcome of an LEWG discussion in a September 2025 teleconference.

## Wording

In [exception.syn], remove the constexpr decl-specifiers from these functions: `<del>constexpr</del> int uncaught_exceptions() noexcept; using exception_ptr = unspecified ; <del>constexpr</del> exception_ptr current_exception() noexcept;`

Before [uncaught.exceptions]/1, remove the constexpr decl-specifier: `<del>constexpr</del> int uncaught_exceptions() noexcept;`

Before [propagation]/9, remove the constexpr decl-specifier: `<del>constexpr</del> exception_ptr current_exception() noexcept;`

In [propagation]/12, edit as follows: `<del>Effects: Creates an exception_ptr object that refers to a copy of e, as if: try { throw e; } catch(...) { return current_exception(); }</del> <ins>Returns: An exception_ptr object that refers to a copy of e.</ins>`

Strike the note In [propagation]/13: `<del>[Note 5: This function is provided for convenience and efficiency reasons. — end note]</del>`
