We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bc3a15 commit dadf771Copy full SHA for dadf771
docs/error-messages/compiler-warnings/compiler-warning-level-1-c4172.md
@@ -18,16 +18,18 @@ Redesign the function so that it does not return the address of a local object.
18
19
## Example
20
21
-The following sample generates C4172:
+The following example generates C4172:
22
23
```cpp
24
// C4172.cpp
25
-// compile with: /W1 /LD
26
-float f = 10;
27
-
28
-const double& bar() {
29
-// try the following line instead
30
-// const float& bar() {
31
- return f; // C4172
+// compile with: /c /W1
+float f = 1.f;
+
+const double& func()
+// Try one of the following lines instead:
+// const float& func()
+// const auto& func()
32
+{
33
+ return f; // C4172
34
}
35
```
0 commit comments