Skip to content

Commit cf7b65d

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2881, C2910]
1 parent 20dcd8b commit cf7b65d

22 files changed

+83
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: b49c63c2-b064-4d4b-a75e-ddd2af947522
1010

1111
> 'namespace1' : is already used as an alias for 'namespace2'
1212
13+
## Remarks
14+
1315
You cannot use the same name as an alias for two namespaces.
1416

17+
## Example
18+
1519
The following sample generates C2881:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 617018ee-5a0d-4b8d-9612-77e8ae52679b
1010

1111
> 'name' : illegal use of namespace identifier in expression
1212
13+
## Remarks
14+
1315
You tried to use the name of a namespace in an expression.
1416

17+
## Example
18+
1519
The following sample generates C2882:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5c6d689d-ed42-41ad-b5c0-e9c2e0b8c356
1010

1111
> 'name' : function declaration conflicts with 'identifier' introduced by using-declaration
1212
13+
## Remarks
14+
1315
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.
1416

17+
## Example
18+
1519
The following sample generates C2883:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 8b4d43e3-3fb5-4360-86c8-de59d8736d4f
1010

1111
> 'name' : introduced by using-declaration conflicts with local function 'function'
1212
13+
## Remarks
14+
1315
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.
1416

17+
## Example
18+
1519
The following sample generates C2884:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7743e5f3-a034-44b4-9ee8-5a6254c27f8c
1010

1111
> 'class::identifier' : not a valid using-declaration at non-class scope
1212
13+
## Remarks
14+
1315
You used a [using](../../cpp/using-declaration.md) declaration incorrectly.
1416

1517
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.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c01588a1-484c-4dc9-a3f1-f900c6e44543
1010

1111
> 'class::identifier' : symbol cannot be used in a member using-declaration
1212
13+
## Remarks
14+
1315
A **`using`** declaration uses a symbol, such as a namespace name. A **`using`** declaration is for declaring base class members.
1416

17+
## Example
18+
1519
The following sample generates C2886:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2888"]
99

1010
> 'identifier' : symbol cannot be defined within namespace 'namespace'
1111
12+
## Remarks
13+
1214
A symbol belonging to namespace A must be defined in a namespace that encloses A.
1315

16+
## Example
17+
1418
The following sample generates C2888:
1519

1620
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 49147375-182c-42b1-b170-f475cd436d47
1010

1111
> 'class' : a ref class can only have one non-interface base class
1212
13+
## Remarks
14+
1315
A reference class can only have one base class.
1416

17+
## Example
18+
1519
The following sample generates C2890:
1620

1721
```cpp

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ helpviewer_keywords: ["C2891"]
99

1010
> '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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c22a5084-2f50-42c2-a56b-6dfe5442edc9
1010

1111
> local class shall not have member templates
1212
13+
## Remarks
14+
1315
Templated member functions are not valid in a class that is defined in a function.
1416

17+
## Example
18+
1519
The following sample generates C2892:
1620

1721
```cpp

0 commit comments

Comments
 (0)