File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
docs/error-messages/compiler-errors-1 Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,21 @@ helpviewer_keywords: ["C2049"]
12
12
The ** ` inline ` ** keyword may be used on a namespace definition extension only if it was also used on the original namespace definition.
13
13
14
14
To resolve this issue, make the use of the ** ` inline ` ** specifier consistent across all parts of the namespace.
15
+
16
+ The following sample generates C2049:
17
+
18
+ ``` cpp
19
+ // C2049.cpp
20
+ namespace ns {}
21
+
22
+ inline namespace ns {} // C2049
23
+ ```
24
+
25
+ Possible resolution:
26
+
27
+ ```cpp
28
+ // C2049b.cpp
29
+ namespace ns {}
30
+
31
+ namespace ns {}
32
+ ```
Original file line number Diff line number Diff line change @@ -13,3 +13,27 @@ static function 'function' declared but not defined
13
13
A forward reference is made to a ** ` static ` ** function that is never defined.
14
14
15
15
A ** ` static ` ** function must be defined within file scope. If the function is defined in another file, it must be declared ** ` extern ` ** .
16
+
17
+ The following sample generates C2129:
18
+
19
+ ``` cpp
20
+ // C2129.cpp
21
+ static void foo (); // C2129
22
+
23
+ int main () {
24
+ foo ();
25
+ }
26
+ ```
27
+
28
+ Possible resolution:
29
+
30
+ ``` cpp
31
+ // C2129b.cpp
32
+ static void foo ();
33
+
34
+ int main () {
35
+ foo ();
36
+ }
37
+
38
+ static void foo () {}
39
+ ```
You can’t perform that action at this time.
0 commit comments