GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

std::exception_ptr declared as type alias in libstdc++

libstdc++ now declares std::exception_ptr as a type alias, matching the C++ standard and improving reflection capabilities.

The C++ standard specifies std::exception_ptr as a type alias. This change modifies libstdc++ to use a type alias declaration instead of a using-declaration, aligning with the standard. This change is observable via reflection and ensures continued support for std::exception_ptr as an extension in C++98 mode.

In Details

This commit changes the definition of std::exception_ptr in libstdc++ from a using-declaration to a typedef-declaration (aliased as type alias). This aligns with the C++ standard's specification in [propagation]. The change is observable via reflection, as demonstrated by a new test case, and preserves C++98 compatibility for this extension.

For Context
type alias
In C++, a type alias is a name that can be used as an alternative to another type. C++11 introduced using for type aliases, which is more flexible than typedef but achieves similar goals. The standard specifies std::exception_ptr as a type alias.
reflection
In programming, reflection is the ability of a program to examine, introspect, and modify its own structure and behavior at runtime. In C++, this can involve inspecting type information.
using-declaration
A using declaration in C++ brings names from a namespace into the current scope. In this context, using std::exception_ptr would make the name available in the std namespace.
Filed Under: libstdc++C++ standardreflection