Skip to content

Commit eb0c1bf

Browse files
author
Colin Robertson
committed
Fix cpp-docs issue 2 Update C2653
1 parent cb09a5f commit eb0c1bf

3 files changed

Lines changed: 62 additions & 10 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "Compiler Error C2429 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "11/04/2016"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "devlang-cpp"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "error-reference"
11+
f1_keywords:
12+
- "C2429"
13+
dev_langs:
14+
- "C++"
15+
helpviewer_keywords:
16+
- "C2429"
17+
ms.assetid: 57ff6df9-5cf1-49f3-8bd8-4e550dfd65a0
18+
caps.latest.revision: 9
19+
author: "corob-msft"
20+
ms.author: "corob"
21+
manager: "ghogen"
22+
translation.priority.ht:
23+
- "cs-cz"
24+
- "de-de"
25+
- "es-es"
26+
- "fr-fr"
27+
- "it-it"
28+
- "ja-jp"
29+
- "ko-kr"
30+
- "pl-pl"
31+
- "pt-br"
32+
- "ru-ru"
33+
- "tr-tr"
34+
- "zh-cn"
35+
- "zh-tw"
36+
---
37+
# Compiler Error C2429
38+
'*language feature*' requires compiler flag '*compiler option*'
39+
40+
The language feature requires a specific compiler option for support.
41+
42+
The error C2429: language feature 'nested-namespace-definition' requires compiler flag '/std:c++latest' is generated if you try to define a *compound namespace*, a namespace that contains one or more scope-nested namespace names, starting in Visual Studio 2015 Update 3. Compound namespace definitions are not allowed in C++ prior to C++17. The compiler supports compound namespace definitions when the [/std:c++latest](../../build/reference/std-specify-language-standard-version.md) compiler option is specified:
43+
```cpp
44+
// C2429a.cpp
45+
namespace a::b { int i; } // C2429 starting in Visual C++ 2015 Update 3.
46+
// Use /std:c++latest to fix, or do this:
47+
// namespace a { namespace b { int i; }}
48+
49+
int main() {
50+
a::b::i = 2;
51+
}
52+
```

‎docs/error-messages/compiler-errors-1/compiler-errors-c2400-through-c2499.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ The articles in this part of the documentation contain information about a subse
6565

6666
[Compiler Error C2428](../../error-messages/compiler-errors-1/compiler-error-c2428.md)
6767

68+
[Compiler Error C2429](../../error-messages/compiler-errors-1/compiler-error-c2429.md)
69+
6870
[Compiler Error C2430](../../error-messages/compiler-errors-1/compiler-error-c2430.md)
6971

7072
[Compiler Error C2431](../../error-messages/compiler-errors-1/compiler-error-c2431.md)

‎docs/error-messages/compiler-errors-2/compiler-error-c2653.md‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dev_langs:
1414
- "C++"
1515
helpviewer_keywords:
1616
- "C2653"
17-
- "CDaoRecordset class, adding records"
1817
ms.assetid: 3f49e731-affd-43a0-a8d0-181db7650bc3
1918
caps.latest.revision: 9
2019
author: "corob-msft"
@@ -38,11 +37,11 @@ translation.priority.ht:
3837
# Compiler Error C2653
3938
'identifier' : is not a class or namespace name
4039

41-
Syntax requires a class, structure, union, or namespace name.
40+
Syntax requires a class, structure, union, or namespace name.
4241

43-
The following sample generates C2653:
42+
The following sample generates C2653:
4443

45-
```
44+
```cpp
4645
// C2653.cpp
4746
// compile with: /c
4847
class yy {
@@ -53,12 +52,11 @@ void xx::func1(int m) {} // C2653
5352
void yy::func1(int m) {} // OK
5453
```
5554
56-
C2653 is also possible if you try to define a compound namespace; compound namespaces are not allowed in C++:
57-
58-
```
55+
C2653 is also possible if you try to define a *compound namespace*, a namespace that contains one or more scope-nested namespace names, when you use a version of Visual C++ prior to Visual Studio 2015 Update 3. Compound namespace definitions are not allowed in C++ prior to C++17. Starting in Visual C++ 2015 Update 3, the compiler supports compound namespace definitions when the [/std:c++latest](../../build/reference/std-specify-language-standard-version.md) compiler option is specified:
56+
```cpp
5957
// C2653b.cpp
60-
namespace a::b {int i;} // C2653
61-
58+
namespace a::b {int i;} // C2653 prior to Visual C++ 2015 Update 3,
59+
// C2429 thereafter. Use /std:c++latest to fix.
6260
namespace a {
6361
namespace b {
6462
int i;
@@ -68,4 +66,4 @@ namespace a {
6866
int main() {
6967
a::b::i = 2;
7068
}
71-
```
69+
```

0 commit comments

Comments
 (0)