Skip to content

Commit 3a348b3

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2791, C2820]
1 parent a97223e commit 3a348b3

25 files changed

+91
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 938ad1fb-75d9-4ce2-ad92-83d6249005b5
1010

1111
> illegal use of 'super': 'class' does not have any base classes
1212
13+
## Remarks
14+
1315
The keyword [super](../../cpp/super.md) was used within the context of a member function of a class that does not have any base classes.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 392cf748-4f5e-4e62-a364-3118d5658408
1010

1111
> 'super' : this keyword must be followed by '::'
1212
13+
## Remarks
14+
1315
The only token that can follow the keyword **`__super`** is `::`.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: ce35f4e8-c357-40ca-95c4-15ff001ad69d
1010

1111
> 'token' : unexpected token following '::', identifier or keyword 'operator' expected
1212
13+
## Remarks
14+
1315
The only tokens that can follow `__super::` are an identifier or the keyword **`operator`**.
1416

17+
## Example
18+
1519
The following sample generates C2793
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: d508191c-9044-4c6a-9119-4bca668c0b93
1010

1111
> 'function' : is not a member of any direct or indirect base class of 'class'
1212
13+
## Remarks
14+
1315
You tried to use [super](../../cpp/super.md) to call a nonexistent member function.
1416

17+
## Example
18+
1519
The following sample generates C2794
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 8cd8c7fe-2add-4871-85f7-9a6afe4ac588
1010

1111
> 'super::function' is not a member function
1212
13+
## Remarks
14+
1315
This error message appears whenever you try to use [super](../../cpp/super.md) to access a member other than a member function.

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

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

1010
> (Obsolete) List initialization inside member initializer list or non-static data member initializer is not implemented.
1111
12+
## Remarks
13+
1214
This warning is obsolete in Visual Studio 2015. In Visual Studio 2013 and earlier versions, the Microsoft C++ compiler does not implement list initialization inside either a member initializer list or a non-static data member initializer. Before Visual Studio 2013 Update 3, this was silently converted to a function call, which could lead to bad code generation. Visual Studio 2013 Update 3 reports this as an error.
1315

16+
## Examples
17+
1418
This example generates C2797:
1519

1620
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ ms.assetid: fb0cd861-b228-4f81-8090-e28344a727e0
1010

1111
> 'super::member' is ambiguous
1212
13+
## Remarks
14+
1315
Multiple inherited structures contain the member you referenced with [super](../../cpp/super.md). You could fix the error by either:
1416

1517
- Removing B1 or B2 from the inheritance list of D.
1618

1719
- Changing the name of the data member in B1 or B2.
1820

21+
## Example
22+
1923
The following sample generates C2798:
2024

2125
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: a2f1a590-9fe6-44cb-ad09-b4505ef47c6a
1010

1111
> 'operator operator' cannot be overloaded
1212
13+
## Remarks
14+
1315
The following operators cannot be overloaded: class member access (`.`), pointer to member (`.*`), scope resolution (`::`), conditional expression (`? :`), and **`sizeof`**.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 35dfc7ea-9e37-4e30-baa1-944dc61302f5
1010

1111
> 'operator operator' must be a non-static member
1212
13+
## Remarks
14+
1315
The following operators can be overloaded only as nonstatic members:
1416

1517
- Assignment `=`
@@ -26,6 +28,8 @@ Possible C2801 causes:
2628

2729
- Overloaded operator is declared **`static`**.
2830

31+
## Example
32+
2933
- The following sample generates C2801:
3034

3135
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 08b68c0e-9382-40ac-8949-39a7a2749e05
1010

1111
> static member 'operator operator' has no formal parameters
1212
13+
## Remarks
14+
1315
An operator declared by a **`static`** member function must have at least one parameter.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)