Skip to content

Commit 7786d58

Browse files
Merge pull request #5649 from Rageking8/structure-error-references-in-range-c2941-c2980
Structure error references in range [C2941, C2980]
2 parents 3d0e274 + 032a585 commit 7786d58

27 files changed

+173
-118
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2941"
32
title: "Compiler Error C2941"
3+
description: "Learn more about: Compiler Error C2941"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2941"]
66
helpviewer_keywords: ["C2941"]
7-
ms.assetid: 1bba94eb-5bf6-468d-8f84-96a6391a7048
87
---
98
# Compiler Error C2941
109

1110
> '*class*' : type-class-id redefined as a local 'item'
1211
12+
## Remarks
13+
1314
You can't use a generic or template class as an item.
1415

1516
This error is obsolete in Visual Studio 2022 and later versions.

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2942"
32
title: "Compiler Error C2942"
3+
description: "Learn more about: Compiler Error C2942"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2942"]
66
helpviewer_keywords: ["C2942"]
7-
ms.assetid: 13abf744-8fa1-450d-886d-e5717c04956e
87
---
98
# Compiler Error C2942
109

1110
> '*class*' : type-class-id redefined as a formal argument of a function
1211
12+
## Remarks
13+
1314
You can't use a generic or template class as a formal argument. You cannot pass an argument directly to the constructor of a generic or template class.
1415

1516
This error is obsolete in Visual Studio 2022 and later versions.
1617

17-
The following sample generates C2942:
18+
## Examples
19+
20+
The following example generates C2942:
1821

1922
```cpp
2023
// C2942.cpp

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2943"
32
title: "Compiler Error C2943"
3+
description: "Learn more about: Compiler Error C2943"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2943"]
66
helpviewer_keywords: ["C2943"]
7-
ms.assetid: ede6565e-d892-44c0-8eee-c69545f3be2e
87
---
98
# Compiler Error C2943
109

1110
> '*class*' : type-class-id redefined as a type argument of a template
1211
12+
## Remarks
13+
1314
You can't use a generic or template class, instead of a symbol, as a generic or template type argument.
1415

1516
This error is obsolete in Visual Studio 2022 and later versions.
1617

17-
The following sample generates C2943:
18+
## Example
19+
20+
The following example generates C2943:
1821

1922
```cpp
2023
// C2943.cpp

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2944"
32
title: "Compiler Error C2944"
3+
description: "Learn more about: Compiler Error C2944"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2944"]
66
helpviewer_keywords: ["C2944"]
7-
ms.assetid: f209e668-e72f-442a-a438-8c4ff43a404a
87
---
98
# Compiler Error C2944
109

1110
> '*class*' : type-class-id redefined as a value argument of a template
1211
12+
## Remarks
13+
1314
You can't use a generic or template class, instead of a symbol, as a template value argument.
1415

1516
This error is obsolete in Visual Studio 2022 and later versions.
1617

17-
The following sample generates C2944:
18+
## Examples
19+
20+
The following example generates C2944:
1821

1922
```cpp
2023
// C2944.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 C2945"
32
title: "Compiler Error C2945"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2945"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2945"]
66
helpviewer_keywords: ["C2945"]
7-
ms.assetid: be640257-7017-45d1-986a-9fe8caab52f3
87
---
98
# Compiler Error C2945
109

11-
explicit instantiation does not refer to a template-class specialization
10+
> explicit instantiation does not refer to a template-class specialization
11+
12+
## Remarks
1213

1314
You cannot explicitly instantiate something that is not templated.

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2946"
32
title: "Compiler Error C2946"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2946"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2946"]
66
helpviewer_keywords: ["C2946"]
7-
ms.assetid: c86dfbfc-7702-4f09-8a53-d205710e99c2
87
---
98
# Compiler Error C2946
109

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

1314
You cannot explicitly instantiate a nontemplated class.
1415

1516
## Example
1617

17-
The following sample generates C2946.
18+
The following example generates C2946.
1819

1920
```cpp
2021
// C2946.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2947"
32
title: "Compiler Error C2947"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2947"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2947"]
66
helpviewer_keywords: ["C2947"]
7-
ms.assetid: 6c056f62-ec90-4883-8a67-aeeb6ec13546
87
---
98
# Compiler Error C2947
109

11-
expecting '>' to terminate construct, found 'syntax'
10+
> expecting '>' to terminate construct, found 'syntax'
11+
12+
## Remarks
1213

1314
A generic or template argument list may not have been terminated correctly.
1415

1516
C2947 can also be generated by syntax errors.
1617

17-
The following sample generates C2947:
18+
## Example
19+
20+
The following example generates C2947:
1821

1922
```cpp
2023
// C2947.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 C2948"
32
title: "Compiler Error C2948"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2948"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2948"]
66
helpviewer_keywords: ["C2948"]
7-
ms.assetid: 780c6ed3-43a0-4112-8d00-b7bf79086c05
87
---
98
# Compiler Error C2948
109

11-
explicit instantiation; storage class specifier 'specifier' not permitted on specialization
10+
> explicit instantiation; storage class specifier 'specifier' not permitted on specialization
11+
12+
## Remarks
1213

1314
You cannot use storage-class specifiers (such as **`extern`**) in a specialization of a template class that was previously explicitly instantiated.

docs/error-messages/compiler-errors-2/compiler-error-c2951.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 C2951"
32
title: "Compiler Error C2951"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2951"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2951"]
66
helpviewer_keywords: ["C2951"]
7-
ms.assetid: c6f95aa2-c894-425b-a51c-d40d70c8daa1
87
---
98
# Compiler Error C2951
109

11-
type declarations are only permitted at global, namespace, or class scope
10+
> type declarations are only permitted at global, namespace, or class scope
11+
12+
## Remarks
1213

1314
You cannot declare a generic or template class outside global or namespace scope. If you make your generic or template declarations in an include file, make sure the include file is at global scope.
1415

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

1720
```cpp
1821
// C2951.cpp

docs/error-messages/compiler-errors-2/compiler-error-c2952.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 C2952"
32
title: "Compiler Error C2952"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2952"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2952"]
66
helpviewer_keywords: ["C2952"]
7-
ms.assetid: a40e18a2-d02c-4511-854f-6c6fd6789a1a
87
---
98
# Compiler Error C2952
109

11-
'declaration' : type declaration missing template parameter list
10+
> 'declaration' : type declaration missing template parameter list
11+
12+
## Remarks
1213

1314
A template declaration was ill formed.
1415

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

1720
```cpp
1821
// C2952.cpp

0 commit comments

Comments
 (0)