summaryrefslogtreecommitdiffstats
path: root/libcxx/docs/UsingLibcxx.rst
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-01-13 22:02:08 +0000
committerEric Fiselier <eric@efcs.ca>2017-01-13 22:02:08 +0000
commitb1e7a12ee89ffcf50d0b18f8c6da7423604ea9d8 (patch)
tree757d7fbfc219efa1b5ddbfbd9956ea8435fbabec /libcxx/docs/UsingLibcxx.rst
parent4e8d1475bdb6fdecd938678e0e0a8e0ab543ffc1 (diff)
downloadbcm5719-llvm-b1e7a12ee89ffcf50d0b18f8c6da7423604ea9d8.tar.gz
bcm5719-llvm-b1e7a12ee89ffcf50d0b18f8c6da7423604ea9d8.zip
Add _LIBCPP_DIAGNOSE_WARNING and _LIBCPP_DIAGNOSE_ERROR macros.
Clang recently added a `diagnose_if(cond, msg, type)` attribute which can be used to generate diagnostics when `cond` is a constant expression that evaluates to true. Otherwise no attribute has no effect. This patch adds _LIBCPP_DIAGNOSE_ERROR/WARNING macros which use this new attribute. Additionally this patch implements a diagnostic message when a non-const-callable comparator is given to a container. Note: For now the warning version of the diagnostic is useless within libc++ since warning diagnostics are suppressed by the system header pragma. I'm going to work on fixing this. llvm-svn: 291961
Diffstat (limited to 'libcxx/docs/UsingLibcxx.rst')
-rw-r--r--libcxx/docs/UsingLibcxx.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst
index de87c9c159d..6d910ca6f30 100644
--- a/libcxx/docs/UsingLibcxx.rst
+++ b/libcxx/docs/UsingLibcxx.rst
@@ -173,3 +173,10 @@ thread safety annotations.
return Tup{"hello world", 42}; // explicit constructor called. OK.
}
+**_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS**:
+ This macro disables the additional diagnostics generated by libc++ using the
+ `diagnose_if` attribute. These additional diagnostics include checks for:
+
+ * Giving `set`, `map`, `multiset`, `multimap` a comparator which is not
+ const callable.
+
OpenPOWER on IntegriCloud