Skip to content

Commit 7745b4c

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2941, C2980]
1 parent f19c659 commit 7745b4c

27 files changed

+85
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1bba94eb-5bf6-468d-8f84-96a6391a7048
1010

1111
> '*class*' : type-class-id redefined as a local 'item'
1212
13+
## Remarks
14+
1315
You can't use a generic or template class as an item.
1416

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 13abf744-8fa1-450d-886d-e5717c04956e
1010

1111
> '*class*' : type-class-id redefined as a formal argument of a function
1212
13+
## Remarks
14+
1315
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.
1416

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

19+
## Examples
20+
1721
The following sample generates C2942:
1822

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: ede6565e-d892-44c0-8eee-c69545f3be2e
1010

1111
> '*class*' : type-class-id redefined as a type argument of a template
1212
13+
## Remarks
14+
1315
You can't use a generic or template class, instead of a symbol, as a generic or template type argument.
1416

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

19+
## Example
20+
1721
The following sample generates C2943:
1822

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: f209e668-e72f-442a-a438-8c4ff43a404a
1010

1111
> '*class*' : type-class-id redefined as a value argument of a template
1212
13+
## Remarks
14+
1315
You can't use a generic or template class, instead of a symbol, as a template value argument.
1416

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

19+
## Examples
20+
1721
The following sample generates C2944:
1822

1923
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: be640257-7017-45d1-986a-9fe8caab52f3
1010

1111
> explicit instantiation does not refer to a template-class specialization
1212
13+
## Remarks
14+
1315
You cannot explicitly instantiate something that is not templated.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c86dfbfc-7702-4f09-8a53-d205710e99c2
1010

1111
> explicit instantiation; 'class' is not a template-class specialization
1212
13+
## Remarks
14+
1315
You cannot explicitly instantiate a nontemplated class.
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 6c056f62-ec90-4883-8a67-aeeb6ec13546
1010

1111
> expecting '>' to terminate construct, found 'syntax'
1212
13+
## Remarks
14+
1315
A generic or template argument list may not have been terminated correctly.
1416

1517
C2947 can also be generated by syntax errors.
1618

19+
## Example
20+
1721
The following sample generates C2947:
1822

1923
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 780c6ed3-43a0-4112-8d00-b7bf79086c05
1010

1111
> explicit instantiation; storage class specifier 'specifier' not permitted on specialization
1212
13+
## Remarks
14+
1315
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c6f95aa2-c894-425b-a51c-d40d70c8daa1
1010

1111
> type declarations are only permitted at global, namespace, or class scope
1212
13+
## Remarks
14+
1315
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.
1416

17+
## Examples
18+
1519
The following sample generates C2951:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: a40e18a2-d02c-4511-854f-6c6fd6789a1a
1010

1111
> 'declaration' : type declaration missing template parameter list
1212
13+
## Remarks
14+
1315
A template declaration was ill formed.
1416

17+
## Examples
18+
1519
The following sample generates C2952:
1620

1721
```cpp

0 commit comments

Comments
 (0)