]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
doc: update [[gnu::no_dangling]]
authorMarek Polacek <polacek@redhat.com>
Mon, 4 Mar 2024 16:25:28 +0000 (11:25 -0500)
committerMarek Polacek <polacek@redhat.com>
Mon, 4 Mar 2024 16:26:09 +0000 (11:26 -0500)
...to offer a more realistic example.

gcc/ChangeLog:

* doc/extend.texi: Update [[gnu::no_dangling]].

gcc/doc/extend.texi

index f679c81acf2e5933fa2ff729f6fe3c57ed0d3278..df0982fdfda5d55d8bdd1bab96840f2d99227c76 100644 (file)
@@ -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