File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,10 @@ on the control flow of the function, an overload where all problematic
42
42
43
43
This issue can also be resolved by adding ``[[clang::lifetimebound]] ``. Clang
44
44
enable ``-Wdangling `` warning by default which can detect mis-uses of the
45
- annotated function. See `lifetimebound attribute<https://clang.llvm.org/docs/AttributeReference.html#id11> `_
45
+ annotated function. See `lifetimebound attribute <https://clang.llvm.org/docs/AttributeReference.html#id11 >`_
46
46
for details.
47
47
48
48
.. code-block :: c++
49
+
49
50
const int &f(const int &a [[clang::lifetimebound]]) { return a; } // no warning
50
51
const int &v = f(1); // warning: temporary bound to local reference 'v' will be destroyed at the end of the full-expression [-Wdangling]
You can’t perform that action at this time.
0 commit comments