Skip to content

Commit f745c17

Browse files
Merge pull request #5546 from Rageking8/structure-error-references-in-range-c2141-c2160
Structure error references in range [C2141, C2160]
2 parents 31fc379 + f63a22c commit f745c17

20 files changed

+132
-93
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2141.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 C2141"
32
title: "Compiler Error C2141"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2141"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2141"]
66
helpviewer_keywords: ["C2141"]
7-
ms.assetid: 10cf770f-0500-4220-ac90-a863b7ea5fe6
87
---
98
# Compiler Error C2141
109

11-
array size overflow
10+
> array size overflow
11+
12+
## Remarks
1213

1314
An array exceeds the 2GB limit. Reduce the size of the array.
1415

1516
## Example
1617

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

1920
```cpp
2021
// C2141.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2142.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 C2142"
32
title: "Compiler Error C2142"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2142"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2142"]
66
helpviewer_keywords: ["C2142"]
7-
ms.assetid: d0dbe10e-0952-49a4-8b33-e82fb7558b19
87
---
98
# Compiler Error C2142
109

11-
function declarations differ, variable parameters specified only in one of them
10+
> function declarations differ, variable parameters specified only in one of them
11+
12+
## Remarks
1213

1314
One declaration of the function contains a variable parameter list. Another declaration does not. ANSI C ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) only.
1415

15-
The following sample generates C2142:
16+
## Example
17+
18+
The following example generates C2142:
1619

1720
```c
1821
// C2142.c

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
---
2-
description: "Learn more about: Compiler Error C2143"
32
title: "Compiler Error C2143"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2143"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2143"]
66
helpviewer_keywords: ["C2143"]
7-
ms.assetid: 1d8d1456-e031-4965-9240-09a6e33ba81c
87
---
98
# Compiler Error C2143
109

11-
syntax error : missing 'token1' before 'token2'
10+
> syntax error : missing 'token1' before 'token2'
11+
12+
## Remarks
1213

1314
The compiler expected a specific token (that is, a language element other than white space) and found another token instead.
1415

1516
Check the [C++ Language Reference](../../cpp/cpp-language-reference.md) to determine where code is syntactically incorrect. Because the compiler may report this error after it encounters the line that causes the problem, check several lines of code that precede the error.
1617

1718
C2143 can occur in different situations.
1819

20+
## Examples
21+
1922
It can occur when an operator that can qualify a name (`::`, `->`, and `.`) must be followed by the keyword **`template`**, as in this example:
2023

2124
```cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2144"
32
title: "Compiler Error C2144"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2144"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2144"]
66
helpviewer_keywords: ["C2144"]
7-
ms.assetid: 49f3959b-324f-4c06-9588-c0ecef5dc5b3
87
---
98
# Compiler Error C2144
109

1110
> syntax error : '*type*' should be preceded by '*token*'
1211
12+
## Remarks
13+
1314
The compiler expected *token* and found *type* instead.
1415

1516
This error may be caused by a missing closing brace, right parenthesis, or semicolon.
@@ -20,7 +21,7 @@ You may also see C2144 if you are trying to do type forwarding. See [Type Forwar
2021

2122
## Examples
2223

23-
The following sample generates C2144, and shows a way to fix it:
24+
The following example generates C2144, and shows a way to fix it:
2425

2526
```cpp
2627
// C2144.cpp
@@ -33,7 +34,7 @@ REF struct MyStruct0; // C2144
3334
REF1 MyStruct1;
3435
```
3536
36-
The following sample generates C2144, and shows a way to fix it:
37+
The following example generates C2144, and shows a way to fix it:
3738
3839
```cpp
3940
// C2144_2.cpp

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2145"
32
title: "Compiler Error C2145"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2145"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2145"]
66
helpviewer_keywords: ["C2145"]
7-
ms.assetid: 158e5809-8adb-4195-8ca5-684501defbc8
87
---
98
# Compiler Error C2145
109

11-
syntax error : missing 'token' before identifier
10+
> syntax error : missing 'token' before identifier
11+
12+
## Remarks
1213

1314
The compiler expected `token` and found identifier instead.
1415

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2146"
32
title: "Compiler Error C2146"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2146"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2146"]
66
helpviewer_keywords: ["C2146"]
7-
ms.assetid: 6bfb7de6-6723-4486-9350-c66ef88d7a64
87
---
98
# Compiler Error C2146
109

11-
syntax error : missing 'token' before identifier 'identifier'
10+
> syntax error : missing 'token' before identifier 'identifier'
11+
12+
## Remarks
1213

1314
The compiler expected `token` and found `identifier` instead. Possible causes:
1415

@@ -20,7 +21,7 @@ This error may be caused by a typographical error. Error [C2065](../../error-mes
2021

2122
## Examples
2223

23-
The following sample generates C2146.
24+
The following example generates C2146.
2425

2526
```cpp
2627
// C2146.cpp
@@ -39,7 +40,7 @@ int main() {
3940
4041
This error can also be generated as a result of compiler conformance work that was done for Visual Studio .NET 2003: missing **`typename`** keyword.
4142
42-
The following sample compiles in Visual Studio .NET 2002 but will fail in Visual Studio .NET 2003:
43+
The following example compiles in Visual Studio .NET 2002 but will fail in Visual Studio .NET 2003:
4344
4445
```cpp
4546
// C2146b.cpp
@@ -64,7 +65,7 @@ You will also see this error as a result of compiler conformance work that was d
6465

6566
The use of `T` from the primary template is not allowed in the explicit specialization. For code to be valid in the Visual Studio .NET 2003 and Visual Studio .NET, replace all instances of the template parameter in the specialization with the explicitly specialized type.
6667

67-
The following sample compiles in Visual Studio .NET but will fail in Visual Studio .NET 2003:
68+
The following example compiles in Visual Studio .NET but will fail in Visual Studio .NET 2003:
6869

6970
```cpp
7071
// C2146_c.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2147.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 C2147"
32
title: "Compiler Error C2147"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2147"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2147"]
66
helpviewer_keywords: ["C2147"]
7-
ms.assetid: d1adb3bf-7ece-4815-922c-ad7492fb6670
87
---
98
# Compiler Error C2147
109

11-
syntax error : 'identifier' is a new keyword
10+
> syntax error : 'identifier' is a new keyword
11+
12+
## Remarks
1213

1314
An identifier was used that is now a reserved keyword in the language.
1415

15-
The following sample generates C2147:
16+
## Example
17+
18+
The following example generates C2147:
1619

1720
```cpp
1821
// C2147.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2148.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 C2148"
32
title: "Compiler Error C2148"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2148"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2148"]
66
helpviewer_keywords: ["C2148"]
7-
ms.assetid: e510c2c9-7b57-4ce8-be03-ba363e2cc5d9
87
---
98
# Compiler Error C2148
109

11-
total size of array must not exceed 0x7fffffff bytes
10+
> total size of array must not exceed 0x7fffffff bytes
11+
12+
## Remarks
1213

1314
An array exceeds the limit. Reduce the size of the array.
1415

1516
## Example
1617

17-
The following sample generates C2148:
18+
The following example generates C2148:
1819

1920
```cpp
2021
// C2148.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2149.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 C2149"
32
title: "Compiler Error C2149"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2149"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2149"]
66
helpviewer_keywords: ["C2149"]
7-
ms.assetid: 7a106dab-d79f-41b9-85be-f36e86e4d2ab
87
---
98
# Compiler Error C2149
109

11-
'identifier' : named bit field cannot have zero width
10+
> 'identifier' : named bit field cannot have zero width
11+
12+
## Remarks
1213

1314
Bit fields can have zero width only if unnamed.
1415

15-
The following sample generates C2149:
16+
## Example
17+
18+
The following example generates C2149:
1619

1720
```cpp
1821
// C2149.cpp

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2150"
32
title: "Compiler Error C2150"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2150"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2150"]
66
helpviewer_keywords: ["C2150"]
7-
ms.assetid: 21e82a10-c1d4-4c0d-9dc6-c5d92ea42a31
87
---
98
# Compiler Error C2150
109

1110
> '*identifier*' : bit field must have type 'int', 'signed int', or 'unsigned int'
1211
12+
## Remarks
13+
1314
The base type for a bit-field is required to be **`int`**, **`signed int`**, or **`unsigned int`**.
1415

1516
## Example
1617

17-
This sample shows how you might encounter C2150, and how you can fix it:
18+
This example shows how you might encounter C2150, and how you can fix it:
1819

1920
```cpp
2021
// C2150.cpp

0 commit comments

Comments
 (0)