@@ -3943,7 +3943,7 @@ In this case, the capturing entity ``X`` could capture a dangling reference to t
3943
3943
temporary object.
3944
3944
3945
3945
.. code-block:: c++
3946
-
3946
+
3947
3947
void addToSet(std::string_view a [[clang::lifetime_capture_by(s)]], std::set<std::string_view>& s) {
3948
3948
s.insert(a);
3949
3949
}
@@ -3957,16 +3957,16 @@ temporary object.
3957
3957
3958
3958
The capturing entity ``X`` can be one of the following:
3959
3959
3960
- - Another (named) function parameter.
3961
-
3960
+ - Another (named) function parameter.
3961
+
3962
3962
.. code-block:: c++
3963
3963
3964
3964
void addToSet(std::string_view a [[clang::lifetime_capture_by(s)]], std::set<std::string_view>& s) {
3965
3965
s.insert(a);
3966
3966
}
3967
3967
3968
3968
- ``this`` (in case of member functions).
3969
-
3969
+
3970
3970
.. code-block:: c++
3971
3971
3972
3972
class S {
@@ -3977,7 +3977,7 @@ The capturing entity ``X`` can be one of the following:
3977
3977
};
3978
3978
3979
3979
- `global`, `unknown`.
3980
-
3980
+
3981
3981
.. code-block:: c++
3982
3982
3983
3983
std::set<std::string_view> s;
@@ -4000,7 +4000,7 @@ function by writing the attribute after the function type:
4000
4000
The attribute supports specifying more than one capturing entities:
4001
4001
4002
4002
.. code-block:: c++
4003
-
4003
+
4004
4004
void addToSets(std::string_view a [[clang::lifetime_capture_by(s1, s2)]],
4005
4005
std::set<std::string_view>& s1,
4006
4006
std::set<std::string_view>& s2) {
@@ -4014,7 +4014,7 @@ statement-local and only detects use of a temporary as an argument to the
4014
4014
annotated parameter.
4015
4015
4016
4016
.. code-block:: c++
4017
-
4017
+
4018
4018
void addToSet(std::string_view a [[clang::lifetime_capture_by(s)]], std::set<std::string_view>& s);
4019
4019
void use() {
4020
4020
std::set<std::string_view> s;
@@ -7174,8 +7174,8 @@ the field it is attached to, and it may also lead to emission of automatic fix-i
7174
7174
hints which would help the user replace the use of unsafe functions(/fields) with safe
7175
7175
alternatives, though the attribute can be used even when the fix can't be automated.
7176
7176
7177
- * Attribute attached to functions: The attribute does not suppress
7178
- ``-Wunsafe-buffer-usage`` inside the function to which it is attached.
7177
+ * Attribute attached to functions: The attribute does not suppress
7178
+ ``-Wunsafe-buffer-usage`` inside the function to which it is attached.
7179
7179
These warnings still need to be addressed.
7180
7180
7181
7181
The attribute is warranted even if the only way a function can overflow
@@ -7238,10 +7238,10 @@ alternatives, though the attribute can be used even when the fix can't be automa
7238
7238
and then use the attribute on the original ``baz()`` to help the users
7239
7239
update their code to use the new function.
7240
7240
7241
- * Attribute attached to fields: The attribute should only be attached to
7242
- struct fields, if the fields can not be updated to a safe type with bounds
7243
- check, such as std::span. In other words, the buffers prone to unsafe accesses
7244
- should always be updated to use safe containers/views and attaching the attribute
7241
+ * Attribute attached to fields: The attribute should only be attached to
7242
+ struct fields, if the fields can not be updated to a safe type with bounds
7243
+ check, such as std::span. In other words, the buffers prone to unsafe accesses
7244
+ should always be updated to use safe containers/views and attaching the attribute
7245
7245
must be last resort when such an update is infeasible.
7246
7246
7247
7247
The attribute can be placed on individual fields or a set of them as shown below.
@@ -7259,7 +7259,7 @@ alternatives, though the attribute can be used even when the fix can't be automa
7259
7259
size_t sz;
7260
7260
};
7261
7261
7262
- Here, every read/write to the fields ptr1, ptr2, buf and sz will trigger a warning
7262
+ Here, every read/write to the fields ptr1, ptr2, buf and sz will trigger a warning
7263
7263
that the field has been explcitly marked as unsafe due to unsafe-buffer operations.
7264
7264
7265
7265
}];
@@ -7814,10 +7814,10 @@ def HLSLLoopHintDocs : Documentation {
7814
7814
let Content = [{
7815
7815
The ``[loop]`` directive allows loop optimization hints to be
7816
7816
specified for the subsequent loop. The directive allows unrolling to
7817
- be disabled and is not compatible with [unroll(x)].
7817
+ be disabled and is not compatible with [unroll(x)].
7818
7818
7819
7819
Specifying the parameter, ``[loop]``, directs the
7820
- unroller to not unroll the loop.
7820
+ unroller to not unroll the loop.
7821
7821
7822
7822
.. code-block:: hlsl
7823
7823
0 commit comments