Skip to content

Commit 29c072d

Browse files
Merge pull request #5645 from Rageking8/structure-error-references-in-range-c2881-c2910
Structure error references in range [C2881, C2910]
2 parents 2690850 + e907b39 commit 29c072d

22 files changed

+166
-103
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c2881.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2881"
32
title: "Compiler Error C2881"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2881"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2881"]
66
helpviewer_keywords: ["C2881"]
7-
ms.assetid: b49c63c2-b064-4d4b-a75e-ddd2af947522
87
---
98
# Compiler Error C2881
109

11-
'namespace1' : is already used as an alias for 'namespace2'
10+
> 'namespace1' : is already used as an alias for 'namespace2'
11+
12+
## Remarks
1213

1314
You cannot use the same name as an alias for two namespaces.
1415

15-
The following sample generates C2881:
16+
## Example
17+
18+
The following example generates C2881:
1619

1720
```cpp
1821
// C2881.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2882.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2882"
32
title: "Compiler Error C2882"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2882"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2882"]
66
helpviewer_keywords: ["C2882"]
7-
ms.assetid: 617018ee-5a0d-4b8d-9612-77e8ae52679b
87
---
98
# Compiler Error C2882
109

11-
'name' : illegal use of namespace identifier in expression
10+
> 'name' : illegal use of namespace identifier in expression
11+
12+
## Remarks
1213

1314
You tried to use the name of a namespace in an expression.
1415

15-
The following sample generates C2882:
16+
## Example
17+
18+
The following example generates C2882:
1619

1720
```cpp
1821
// C2882.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2883.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2883"
32
title: "Compiler Error C2883"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2883"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2883"]
66
helpviewer_keywords: ["C2883"]
7-
ms.assetid: 5c6d689d-ed42-41ad-b5c0-e9c2e0b8c356
87
---
98
# Compiler Error C2883
109

11-
'name' : function declaration conflicts with 'identifier' introduced by using-declaration
10+
> 'name' : function declaration conflicts with 'identifier' introduced by using-declaration
11+
12+
## Remarks
1213

1314
You tried to define a function more than once. The first definition was made from a namespace with a **`using`** declaration. The second was a local definition.
1415

15-
The following sample generates C2883:
16+
## Example
17+
18+
The following example generates C2883:
1619

1720
```cpp
1821
// C2883.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2884.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2884"
32
title: "Compiler Error C2884"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2884"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2884"]
66
helpviewer_keywords: ["C2884"]
7-
ms.assetid: 8b4d43e3-3fb5-4360-86c8-de59d8736d4f
87
---
98
# Compiler Error C2884
109

11-
'name' : introduced by using-declaration conflicts with local function 'function'
10+
> 'name' : introduced by using-declaration conflicts with local function 'function'
11+
12+
## Remarks
1213

1314
You tried to define a function more than once. The first definition is a local definition. The second is from a namespace with a **`using`** declaration.
1415

15-
The following sample generates C2884:
16+
## Example
17+
18+
The following example generates C2884:
1619

1720
```cpp
1821
// C2884.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2885.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2885"
32
title: "Compiler Error C2885"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2885"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2885"]
66
helpviewer_keywords: ["C2885"]
7-
ms.assetid: 7743e5f3-a034-44b4-9ee8-5a6254c27f8c
87
---
98
# Compiler Error C2885
109

11-
'class::identifier' : not a valid using-declaration at non-class scope
10+
> 'class::identifier' : not a valid using-declaration at non-class scope
11+
12+
## Remarks
1213

1314
You used a [using](../../cpp/using-declaration.md) declaration incorrectly.
1415

1516
This error can be generated as a result of compiler conformance work that was done for Visual Studio 2005: it is no longer valid to have a **`using`** declaration to a nested type; you must explicitly qualify each reference you make to the nested type, put the type in a namespace, or create a typedef.
1617

1718
## Examples
1819

19-
The following sample generates C2885.
20+
The following example generates C2885.
2021

2122
```cpp
2223
// C2885.cpp
@@ -47,7 +48,7 @@ int main () {
4748
4849
If you use the **`using`** keyword with a class member, C++ requires you to define that member inside another class (a derived class).
4950
50-
The following sample generates C2885.
51+
The following example generates C2885.
5152
5253
```cpp
5354
// C2885_b.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2886.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2886"
32
title: "Compiler Error C2886"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2886"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2886"]
66
helpviewer_keywords: ["C2886"]
7-
ms.assetid: c01588a1-484c-4dc9-a3f1-f900c6e44543
87
---
98
# Compiler Error C2886
109

11-
'class::identifier' : symbol cannot be used in a member using-declaration
10+
> 'class::identifier' : symbol cannot be used in a member using-declaration
11+
12+
## Remarks
1213

1314
A **`using`** declaration uses a symbol, such as a namespace name. A **`using`** declaration is for declaring base class members.
1415

15-
The following sample generates C2886:
16+
## Example
17+
18+
The following example generates C2886:
1619

1720
```cpp
1821
// C2886.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2888.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ helpviewer_keywords: ["C2888"]
77
---
88
# Compiler Error C2888
99

10-
'identifier' : symbol cannot be defined within namespace 'namespace'
10+
> 'identifier' : symbol cannot be defined within namespace 'namespace'
11+
12+
## Remarks
1113

1214
A symbol belonging to namespace A must be defined in a namespace that encloses A.
1315

14-
The following sample generates C2888:
16+
## Example
17+
18+
The following example generates C2888:
1519

1620
```cpp
1721
// C2888.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2890.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2890"
32
title: "Compiler Error C2890"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2890"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2890"]
66
helpviewer_keywords: ["C2890"]
7-
ms.assetid: 49147375-182c-42b1-b170-f475cd436d47
87
---
98
# Compiler Error C2890
109

11-
'class' : a ref class can only have one non-interface base class
10+
> 'class' : a ref class can only have one non-interface base class
11+
12+
## Remarks
1213

1314
A reference class can only have one base class.
1415

15-
The following sample generates C2890:
16+
## Example
17+
18+
The following example generates C2890:
1619

1720
```cpp
1821
// C2890.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2891.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ helpviewer_keywords: ["C2891"]
77
---
88
# Compiler Error C2891
99

10-
'parameter' : cannot take the address of a template parameter
10+
> 'parameter' : cannot take the address of a template parameter
1111
12-
You can't take the address of a template parameter unless it is an lvalue. Type parameters are not lvalues because they have no address. Non-type values in template parameter lists that are not lvalues also do not have an address. This is an example of code that causes Compiler Error C2891, because the value passed as the template parameter is a compiler-generated copy of the template argument.
12+
## Remarks
13+
14+
You can't take the address of a template parameter unless it is an lvalue. Type parameters are not lvalues because they have no address. Non-type values in template parameter lists that are not lvalues also do not have an address.
15+
16+
## Example
17+
18+
This is an example of code that causes Compiler Error C2891, because the value passed as the template parameter is a compiler-generated copy of the template argument.
1319

1420
```cpp
1521
template <int i> int* f() { return &i; }

docs/error-messages/compiler-errors-2/compiler-error-c2892.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2892"
32
title: "Compiler Error C2892"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2892"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2892"]
66
helpviewer_keywords: ["C2892"]
7-
ms.assetid: c22a5084-2f50-42c2-a56b-6dfe5442edc9
87
---
98
# Compiler Error C2892
109

11-
local class shall not have member templates
10+
> local class shall not have member templates
11+
12+
## Remarks
1213

1314
Templated member functions are not valid in a class that is defined in a function.
1415

15-
The following sample generates C2892:
16+
## Example
17+
18+
The following example generates C2892:
1619

1720
```cpp
1821
// C2892.cpp

0 commit comments

Comments
 (0)