Skip to content

Commit 9f8717a

Browse files
authored
Merge pull request #5043 from MicrosoftDocs/main
9/26/2023 AM Publish
2 parents 2f1966d + bfefa39 commit 9f8717a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2049.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,21 @@ helpviewer_keywords: ["C2049"]
1212
The **`inline`** keyword may be used on a namespace definition extension only if it was also used on the original namespace definition.
1313

1414
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+
```

docs/error-messages/compiler-errors-1/compiler-error-c2129.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,27 @@ static function 'function' declared but not defined
1313
A forward reference is made to a **`static`** function that is never defined.
1414

1515
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+
```

0 commit comments

Comments
 (0)