R.5 (scoped objects): Remove auto from Enforcement section (#1979)

The enforcement rule on "an object is allocated and then deallocated on all paths" is not _specifically_ about objects declared by the `auto` keyword, and `auto` does not just mean "automatic storage duration" anymore.
This commit is contained in:
Niels Dekker
2022-10-13 23:03:43 +02:00
committed by GitHub
parent 8181873753
commit 40ce5d12c3

View File

@@ -9562,7 +9562,7 @@ Instead, use a local variable:
##### Enforcement
* (Moderate) Warn if an object is allocated and then deallocated on all paths within a function. Suggest it should be a local `auto` stack object instead.
* (Moderate) Warn if an object is allocated and then deallocated on all paths within a function. Suggest it should be a local stack object instead.
* (Simple) Warn if a local `Unique_pointer` or `Shared_pointer` is not moved, copied, reassigned or `reset` before its lifetime ends.
### <a name="Rr-global"></a>R.6: Avoid non-`const` global variables