Skip to content

Commit 2720b85

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2261, C2290]
1 parent 67a7184 commit 2720b85

22 files changed

+72
-2
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2261.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 60969482-9e83-49b5-9631-a04bc844da12
1010

1111
> 'string' : assembly reference is invalid and cannot be resolved
1212
13+
## Remarks
14+
1315
A value was not valid.
1416

1517
<xref:System.Runtime.CompilerServices.InternalsVisibleToAttribute> is used to specify a friend assembly. For example, if a.dll wants to specify b.dll as a friend assembly, you would specify (in a.dll): InternalsVisibleTo("b"). The runtime then allows b.dll to access everything in a.dll (except private types).

docs/error-messages/compiler-errors-1/compiler-error-c2262.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 727d1c6e-53e8-40e5-b7b8-6a7ac2011727
1010

1111
> 'attribute_specifiers' : InternalsVisibleTo declarations cannot have a version, culture, or processor architecture specified
1212
13+
## Remarks
14+
1315
The <xref:System.Runtime.CompilerServices.InternalsVisibleToAttribute> attribute was not specified correctly.
1416

1517
## Example

docs/error-messages/compiler-errors-1/compiler-error-c2264.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 158b72cc-cee9-4a08-bd79-b7a5955345a8
1010

1111
> 'function' : error in function definition or declaration; function not called
1212
13+
## Remarks
14+
1315
The function cannot be called due to an incorrect definition or declaration.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2266.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 5c267a67-d5a1-4ad7-b6f7-a156510aee35
1010

1111
> 'identifier' : reference to a non-constant bounded array is illegal
1212
13+
## Remarks
14+
1315
A reference is declared for an array with a nonconstant bound. The array must have constant bounds.

docs/error-messages/compiler-errors-1/compiler-error-c2267.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: ea63bebb-6208-4367-8440-39be07f9c360
1010

1111
> 'function' : static functions with block scope are illegal
1212
13+
## Remarks
14+
1315
A local function is declared **`static`**. Static functions must have global scope.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2268.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 0ed055c9-3c6f-4df2-a5b6-85cf0e01a249
1010

1111
> 'function' is a compiler predefined library helper. Library helpers are not supported with /GL; compile object file 'file' without /GL.
1212
13+
## Remarks
14+
1315
A function defined in your source code has the same name as an internal compiler function. Compile the module containing the function without [/GL](../../build/reference/gl-whole-program-optimization.md).
1416

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

1721
```c

docs/error-messages/compiler-errors-1/compiler-error-c2270.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: b52c068e-0b61-42e7-b775-4d57b3ddcba0
1010

1111
> 'function' : modifiers not allowed on nonmember functions
1212
13+
## Remarks
14+
1315
A nonmember function is declared with [const](../../cpp/const-cpp.md), [volatile](../../cpp/volatile-cpp.md), or another memory-model modifier.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2271.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: ea47bf57-f55d-4171-8e98-95a71d62820e
1010

1111
> 'operator' : new/delete cannot have formal list modifiers
1212
13+
## Remarks
14+
1315
The operator (**`new`** or **`delete`**) is declared with a memory-model specifier.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2272.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 1517706a-9c27-452e-9b10-3424b3d232bc
1010

1111
> 'function' : modifiers not allowed on static member functions
1212
13+
## Remarks
14+
1315
A **`static`** member function is declared with a memory-model specifier, such as [const](../../cpp/const-cpp.md) or [volatile](../../cpp/volatile-cpp.md), and such modifiers are not allowed on **`static`** member functions.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2273.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 3c682c66-97bf-4a23-a22c-d9a26a92bf95
1010

1111
> 'type' : illegal as right side of '->' operator
1212
13+
## Remarks
14+
1315
A type appears as the right operand of a `->` operator.
1416

1517
This error can be caused by trying to access a user-defined type conversion. Use the keyword **`operator`** between -> and `type`.
1618

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

1923
```cpp

0 commit comments

Comments
 (0)