Skip to content

Commit 2e37613

Browse files
authored
Add cpp language for code blocks in error or warning references
1 parent 99ba4b7 commit 2e37613

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This warning is obsolete in Visual Studio 2015. In Visual Studio 2013 and earlie
1414

1515
This example generates C2797:
1616

17-
```
17+
```cpp
1818
#include <vector>
1919
struct S {
2020
S() : v1{1} {} // C2797, VS2013 RTM incorrectly calls 'vector(size_type)'
@@ -26,7 +26,7 @@ struct S {
2626
2727
This example also generates C2797:
2828
29-
```
29+
```cpp
3030
struct S1 {
3131
int i;
3232
};
@@ -40,7 +40,7 @@ struct S2 {
4040

4141
To fix this issue, you can use explicit construction of inner lists. For example:
4242

43-
```
43+
```cpp
4444
#include <vector>
4545
typedef std::vector<int> Vector;
4646
struct S {
@@ -53,7 +53,7 @@ struct S {
5353
5454
If you do not require list initialization:
5555
56-
```
56+
```cpp
5757
struct S {
5858
S() : s1("") {}
5959

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ ms.assetid: e12cfb2d-df45-4b0d-b155-c51d17e812fa
1212

1313
You can't take the address of a template parameter unless it is an lvalue. Type parameters are not lvalues because they have no address. Non-type values in template parameter lists that are not lvalues also do not have an address. This is an example of code that causes Compiler Error C2891, because the value passed as the template parameter is a compiler-generated copy of the template argument.
1414

15-
```
15+
```cpp
1616
template <int i> int* f() { return &i; }
1717
```
1818
1919
Template parameters that are lvalues, such as reference types, can have their address taken.
2020
21-
```
21+
```cpp
2222
template <int& r> int* f() { return &r; }
2323
```
2424

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Source annotation attributes, unlike CLR custom attribute or compiler attributes
1616

1717
The following sample generates C3457.
1818

19-
```
19+
```cpp
2020
#include "SourceAnnotations.h"
2121
[vc_attributes::Post( 1 )] int f(); // C3457
2222
[vc_attributes::Post( Valid=vc_attributes::Yes )] int f2(); // OK

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: aede18d5-fefc-4da9-9b69-adfe90bfa742
1212

1313
You cannot qualify the `decltype()` keyword with any type specifier. For example, the following code fragment yields error C3554.
1414

15-
```
15+
```cpp
1616
int x;
1717
unsigned decltype(x); // C3554
1818
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The wrong syntax was used for a COM event. To fix this error, change the event t
1414

1515
The following sample generates C3733:
1616

17-
```
17+
```cpp
1818
#define _ATL_ATTRIBUTES 1
1919
#include "atlbase.h"
2020
#include "atlcom.h"

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4626.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This warning is off by default. See [Compiler Warnings That Are Off by Default](
1616

1717
The following sample generates C4626 and shows how to fix it:
1818

19-
```
19+
```cpp
2020
// C4626
2121
// compile with: /W4
2222
#pragma warning(default : 4626)

0 commit comments

Comments
 (0)