summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets/cpp-debug.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets/cpp-debug.md')
-rw-r--r--docs/markdown/snippets/cpp-debug.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/cpp-debug.md b/docs/markdown/snippets/cpp-debug.md
new file mode 100644
index 000000000..2a62b9399
--- /dev/null
+++ b/docs/markdown/snippets/cpp-debug.md
@@ -0,0 +1,10 @@
+## `ndebug` setting now controls C++ stdlib assertions
+
+The `ndebug` setting, if disabled, now passes preprocessor defines to enable
+debugging assertions within the C++ standard library.
+
+For GCC, `-D_GLIBCXX_ASSERTIONS=1` is set.
+
+For Clang, `-D_GLIBCXX_ASSERTIONS=1` is set to cover libstdc++ usage,
+and `-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE` or
+`-D_LIBCPP_ENABLE_ASSERTIONS=1` is used depending on the Clang version.