Skip to content

Commit d6f574b

Browse files
committed
[libc++] Document that internal aliases should be marked _LIBCPP_NODEBUG
1 parent 3b92cf2 commit d6f574b

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 don't care about usually, since users don't try to debug standard library facilities in most cases. For that
193+
reason, all library-internal type aliases should be annotated with ``_LIBCPP_NODEBUG`` to suppress compilers from
194+
generating said debug information.
195+
196+
This is enforced by the clang-tidy check ``libcpp-nodebug-on-aliases``.

0 commit comments

Comments
 (0)