[gcc r14-9300] doc: update [[gnu::no_dangling]]
Marek Polacek
mpolacek@gcc.gnu.org
Mon Mar 4 16:30:16 GMT 2024
https://gcc.gnu.org/g:a89c5df317d1de74871e2a05c36aed9cbbb21f42
commit r14-9300-ga89c5df317d1de74871e2a05c36aed9cbbb21f42
Author: Marek Polacek <polacek@redhat.com>
Date: Mon Mar 4 11:25:28 2024 -0500
doc: update [[gnu::no_dangling]]
...to offer a more realistic example.
gcc/ChangeLog:
* doc/extend.texi: Update [[gnu::no_dangling]].
Diff:
---
gcc/doc/extend.texi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index f679c81acf2..df0982fdfda 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -29370,7 +29370,8 @@ Or:
@smallexample
template <typename T>
-[[gnu::no_dangling(std::is_reference_v<T>)]] int& foo (T& t) @{
+[[gnu::no_dangling(std::is_lvalue_reference_v<T>)]]
+decltype(auto) foo(T&& t) @{
@dots{}
@};
@end smallexample
More information about the Gcc-cvs
mailing list