Skip to content

Commit 997393d

Browse files
committed
[libc++] Document that internal aliases should be marked _LIBCPP_NODEBUG
1 parent 455b3d6 commit 997393d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libcxx/docs/CodingGuidelines.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,13 @@ headers (which is sometimes required for ``constexpr`` support).
184184

185185
When defining a function at the ABI boundary, it can also be useful to consider which attributes (like ``[[gnu::pure]]``
186186
and ``[[clang::noescape]]``) can be added to the function to improve the compiler's ability to optimize.
187+
188+
Library-internal type aliases should be annotated with ``_LIBCPP_NODEBUG``
189+
==========================================================================
190+
191+
Libc++ has lots of internal type aliases. Accumulated, these can result in significant amounts of debug information that
192+
users generally don't care about, since users don't try to debug standard library facilities in most cases. For that
193+
reason, all library-internal type aliases that aren't function-local should be annotated with ``_LIBCPP_NODEBUG`` to
194+
prevent compilers from generating said debug information.
195+
196+
This is enforced by the clang-tidy check ``libcpp-nodebug-on-aliases``.

0 commit comments

Comments
 (0)