Skip to content

Commit 1d2dfc2

Browse files
authored
Add example for C2049 (#4722)
1 parent 0f917d5 commit 1d2dfc2

File tree

1 file changed

+18
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)