Skip to content

Commit 3d0e274

Browse files
Merge pull request #5648 from Rageking8/structure-error-references-in-range-c2911-c2940
Structure error references in range [C2911, C2940]
2 parents 29c072d + 2d3669c commit 3d0e274

23 files changed

+148
-93
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c2911.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 C2911"
32
title: "Compiler Error C2911"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2911"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2911"]
66
helpviewer_keywords: ["C2911"]
7-
ms.assetid: 83c7c01a-ab6a-4179-9fb0-289a9ec8d44e
87
---
98
# Compiler Error C2911
109

11-
'member' : cannot be declared or defined in the current scope
10+
> 'member' : cannot be declared or defined in the current scope
11+
12+
## Remarks
1213

1314
Inside a namespace, class, or function, you can only define a member of the same namespace, class, or function or a member that is enclosed by the same namespace, class, or function.
1415

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

1720
```cpp
1821
// C2911.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2912.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 C2912"
32
title: "Compiler Error C2912"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2912"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2912"]
66
helpviewer_keywords: ["C2912"]
7-
ms.assetid: bd55cecd-ab1a-4636-ab8a-a00393fe7b3d
87
---
98
# Compiler Error C2912
109

11-
explicit specialization 'declaration' is not a specialization of a function template
10+
> explicit specialization 'declaration' is not a specialization of a function template
11+
12+
## Remarks
1213

1314
You cannot specialize a non-template function.
1415

15-
The following sample generates C2912:
16+
## Examples
17+
18+
The following example generates C2912:
1619

1720
```cpp
1821
// C2912.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2913.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 C2913"
32
title: "Compiler Error C2913"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2913"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2913"]
66
helpviewer_keywords: ["C2913"]
7-
ms.assetid: c6cf6090-02e8-49a5-913f-5bc6f864b769
87
---
98
# Compiler Error C2913
109

11-
explicit specialization; 'declaration' is not a specialization of a class template
10+
> explicit specialization; 'declaration' is not a specialization of a class template
11+
12+
## Remarks
1213

1314
You cannot specialize a non-template class.
1415

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

1720
```cpp
1821
// C2913.cpp

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2914"
32
title: "Compiler Error C2914"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2914"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2914"]
66
helpviewer_keywords: ["C2914"]
7-
ms.assetid: fc6a0592-f53e-4f5a-88cb-780bbed4acf2
87
---
98
# Compiler Error C2914
109

11-
'identifier' : cannot deduce type argument as function argument is ambiguous
10+
> 'identifier' : cannot deduce type argument as function argument is ambiguous
11+
12+
## Remarks
1213

1314
The compiler cannot determine which overloaded functions to use for a generic or template argument.
1415

15-
The following sample generates C2914:
16+
## Examples
17+
18+
The following example generates C2914:
1619

1720
```cpp
1821
// C2914.cpp
@@ -25,7 +28,7 @@ void h() { g(f); } // C2914
2528
// void h() { g<int>(f); }
2629
```
2730
28-
C2914 can also occur when using generics. The following sample generates C2914:
31+
C2914 can also occur when using generics. The following example generates C2914:
2932
3033
```cpp
3134
// C2914b.cpp

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Error C2917"
32
title: "Compiler Error C2917"
3+
description: "Learn more about: Compiler Error C2917"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2917"]
66
helpviewer_keywords: ["C2917"]
7-
ms.assetid: ec9da9ee-0f37-47b3-87dd-19ef5a14dc4c
87
---
98
# Compiler Error C2917
109

@@ -18,7 +17,7 @@ This error is obsolete in Visual Studio 2022 and later versions.
1817

1918
## Example
2019

21-
The following sample generates C2917.
20+
The following example generates C2917.
2221

2322
```cpp
2423
// C2917.cpp
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Error C2918"
32
title: "Compiler Error C2918"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2918"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2918"]
66
helpviewer_keywords: ["C2918"]
7-
ms.assetid: e452f7ef-0590-45e6-9c7c-ee75dc014670
87
---
98
# Compiler Error C2918
109

11-
'name': Indexed properties cannot be used on the published surface of a WinRT type
10+
> 'name': Indexed properties cannot be used on the published surface of a WinRT type
11+
12+
## Remarks
1213

1314
Indexed properties are not supported on the published surface of a WinRT type.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2919"
32
title: "Compiler Error C2919"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2919"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2919"]
66
helpviewer_keywords: ["C2919"]
7-
ms.assetid: 140a6db9-eb48-4c5e-84a7-a09d2653605b
87
---
98
# Compiler Error C2919
109

11-
'type': Operators cannot be used on the published surface of a WinRT type
10+
> 'type': Operators cannot be used on the published surface of a WinRT type
11+
12+
## Remarks
1213

1314
The Windows Runtime type system does not support operator member functions in the published surface of a type. This is because not all languages can consume operator member functions. You can create private or internal operator member functions that can be called from C++ code in the same class or compilation unit.
1415

docs/error-messages/compiler-errors-2/compiler-error-c2920.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 C2920"
32
title: "Compiler Error C2920"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2920"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2920"]
66
helpviewer_keywords: ["C2920"]
7-
ms.assetid: 0a4cb2de-00a0-4209-8160-c7ce6ed7d9ab
87
---
98
# Compiler Error C2920
109

11-
redefinition : 'class' : class template or generic has already been declared as 'type'
10+
> redefinition : 'class' : class template or generic has already been declared as 'type'
11+
12+
## Remarks
1213

1314
A generic or template class has multiple declarations, which are not equivalent. To fix this error, use different names for different types, or remove the redefinition of the type name.
1415

15-
The following sample generates C2920 and shows how to fix it:
16+
## Examples
17+
18+
The following example generates C2920 and shows how to fix it:
1619

1720
```cpp
1821
// C2920.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2921.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 C2921"
32
title: "Compiler Error C2921"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2921"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2921"]
66
helpviewer_keywords: ["C2921"]
7-
ms.assetid: 323642a0-bfc4-4942-9f41-c3adf5c54296
87
---
98
# Compiler Error C2921
109

11-
redefinition : 'class' : class template or generic is being redeclared as 'type'
10+
> redefinition : 'class' : class template or generic is being redeclared as 'type'
11+
12+
## Remarks
1213

1314
A generic or template class has multiple declarations that are not equivalent. To fix this error, use different names for different types, or remove the redefinition of the type name.
1415

15-
The following sample generates C2921:
16+
## Examples
17+
18+
The following example generates C2921:
1619

1720
```cpp
1821
// C2921.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2923.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 C2923"
32
title: "Compiler Error C2923"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2923"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2923"]
66
helpviewer_keywords: ["C2923"]
7-
ms.assetid: 6b92933b-13ef-4124-99d9-b89f9fdae030
87
---
98
# Compiler Error C2923
109

11-
'type' : 'identifier' is not a valid template type argument for parameter 'param'
10+
> 'type' : 'identifier' is not a valid template type argument for parameter 'param'
11+
12+
## Remarks
1213

1314
The argument list is missing a type needed to instantiate the template or generic. Check the template or generic declaration.
1415

15-
The following sample generates C2923:
16+
## Examples
17+
18+
The following example generates C2923:
1619

1720
```cpp
1821
// C2923.cpp

0 commit comments

Comments
 (0)