Skip to content

Commit 4057a7b

Browse files
authored
Add "Remarks" and "Example" headings for warning references in range [C4521, C4560]
1 parent 8ccf0cc commit 4057a7b

25 files changed

+80
-2
lines changed

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4526.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 490f8916-5fdc-4cad-b412-76c3382a5976
1010

1111
> 'function' : static member function cannot override virtual function 'virtual function'override ignored, virtual function will be hidden
1212
13+
## Remarks
14+
1315
The static member function meets the criteria to override the virtual function, which makes the member function both virtual and static.
1416

17+
## Example
18+
1519
The following code generates C4526:
1620

1721
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4530.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: a04dcdb2-84db-459d-9e5e-4e743887465f
1010

1111
> C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1212
13-
The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.
14-
1513
## Remarks
1614

15+
The code uses C++ exception handling, but [/EHsc](../../build/reference/eh-exception-handling-model.md) wasn't included in the compiler options.
16+
1717
The compiler requires the **`/EHsc`** option to build C++ code that follows the C++ standard for exception handling. Standard C++ *unwind semantics* specifies that objects and stack frames constructed between where an exception is thrown and where it's caught must be destroyed and their resources recovered. This process is known as *unwinding the stack*.
1818

1919
The **`/EHsc`** option tells the compiler to generate code that calls the destructors on automatic storage objects when an exception passes through the containing stack frame. *Automatic storage* objects are objects allocated on the stack, such as local variables. It's called automatic storage because it's allocated automatically when functions are called, and released automatically when they return. A *stack frame* is the data placed on the stack when a function is called, along with its automatic storage.

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4540.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 8085e748-5f4d-43c2-b06d-eaf794edbf72
1010

1111
> dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')
1212
13+
## Remarks
14+
1315
You used **`dynamic_cast`** to convert from one type to another. The compiler determined that the cast would always fail (return **NULL**) because a base class is inaccessible (**`private`**, for instance) or ambiguous (appears more than once in the class hierarchy, for instance).
1416

17+
## Example
18+
1519
The following shows an example of this warning. Class **B** is derived from class **A**. The program uses **`dynamic_cast`** to cast from class **B** (the derived class) to class **A**, which will always fail because class **B** is **`private`** and thus inaccessible. Changing the access of **A** to **`public`** will resolve the warning.
1620

1721
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4544.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 11ee04df-41ae-435f-af44-881e801315a8
1010

1111
> 'declaration': Default template argument ignored on this template declaration
1212
13+
## Remarks
14+
1315
A default template argument was specified in an incorrect location and was ignored. A default template argument for a class template can only be specified in the declaration or definition of the class template and not on a member of the class template.
1416

17+
## Example
18+
1519
This sample generates C4545, and the next sample shows how to fix it:
1620

1721
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4545.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 43f8f34f-ed46-4661-95c0-c588c577ff73
1010

1111
> expression before comma evaluates to a function which is missing an argument list
1212
13+
## Remarks
14+
1315
The compiler detected an ill-formed comma expression.
1416

1517
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1618

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

1923
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4546.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 071e1709-3841-46c1-8e71-96109cd22041
1010

1111
> function call before comma missing argument list
1212
13+
## Remarks
14+
1315
The compiler detected an ill-formed comma expression.
1416

1517
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4547.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 3edf1c2e-c0d5-444d-ae83-44a7cce24bb2
1010

1111
> 'operator' : operator before comma has no effect; expected operator with side-effect
1212
13+
## Remarks
14+
1315
The compiler detected an ill-formed comma expression.
1416

1517
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1618

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

1923
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4548.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 2cee817e-e463-4d90-bbd2-de120d48c101
1010

1111
> expression before comma has no effect; expected expression with side-effect
1212
13+
## Remarks
14+
1315
The compiler detected an ill-formed comma expression.
1416

1517
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1618

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

1923
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4549.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 81a07676-625b-4f58-9b0c-3ee22830b04a
1010

1111
> 'operator' : operator before comma has no effect; did you intend 'operator'?
1212
13+
## Remarks
14+
1315
The compiler detected an ill-formed comma expression.
1416

1517
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1618

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

1923
```cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4550.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: f902b4ed-5f17-48ea-b693-92f4fb8c8054
1010

1111
> expression evaluates to a function which is missing an argument list
1212
13+
## Remarks
14+
1315
A dereferenced pointer to a function is missing an argument list.
1416

1517
## Example

0 commit comments

Comments
 (0)