Skip to content

Commit a3223c7

Browse files
authored
Merge pull request #1755 from NextTurn/cpp-2
Add language identifiers
2 parents 253eb62 + 353f4d4 commit a3223c7

File tree

739 files changed

+1572
-1572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

739 files changed

+1572
-1572
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A class cannot be specified as a direct base class more than once. A class can b
1717

1818
The following sample generates C2500:
1919

20-
```
20+
```cpp
2121
// C2500.cpp
2222
// compile with: /c
2323
class A {};
@@ -27,4 +27,4 @@ class B : public A, public A {}; // C2500
2727
class C : public A {};
2828
class D : public A {};
2929
class E : public C, public D {};
30-
```
30+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The base class has more than one access modifier. Only one access modifier (`pub
1313

1414
The following sample generates C2502:
1515

16-
```
16+
```cpp
1717
// C2502.cpp
1818
// compile with: /c
1919
class A { };
@@ -23,4 +23,4 @@ class C : private public A { }; // C2502
2323
// OK
2424
class D : private A {};
2525
class E : public A, private B {};
26-
```
26+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A base class or structure contains a zero-sized array. An array in a class must
1313

1414
The following sample generates C2503:
1515

16-
```
16+
```cpp
1717
// C2503.cpp
1818
// compile with: /c
1919
class A {
@@ -29,4 +29,4 @@ public:
2929
};
3030

3131
class D : C {};
32-
```
32+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The base class is declared but never defined. Possible causes:
1717

1818
The following sample generates C2504:
1919

20-
```
20+
```cpp
2121
// C2504.cpp
2222
// compile with: /c
2323
class A;
@@ -29,4 +29,4 @@ class B : public A {}; // C2504
2929
```
3030
class C{};
3131
class D : public C {};
32-
```
32+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For more information, see [appdomain](../../cpp/appdomain.md) and [process](../.
1515

1616
The following sample generates C2505:
1717

18-
```
18+
```cpp
1919
// C2505.cpp
2020
// compile with: /clr
2121

@@ -27,4 +27,4 @@ int main() {
2727
__declspec(process) int i; // C2505
2828
__declspec(appdomain) int j; // C2505
2929
}
30-
```
30+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ See [appdomain](../../cpp/appdomain.md) for more information.
1717

1818
The following sample generates C2506.
1919

20-
```
20+
```cpp
2121
// C2506.cpp
2222
// compile with: /clr /c
2323
ref struct R {
2424
__declspec(process) static int n; // C2506
2525
int o; // OK
2626
};
27-
```
27+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ A class or structure is declared as `virtual` more than once. Only one `virtual`
1313

1414
The following sample generates C2507:
1515

16-
```
16+
```cpp
1717
// C2507.cpp
1818
// compile with: /c
1919
class A {};
2020
class B : virtual virtual public A {}; // C2507
2121
class C : virtual public A {}; // OK
22-
```
22+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The function is not declared in the specified class.
1515

1616
The following sample generates C2509.
1717

18-
```
18+
```cpp
1919
// C2509.cpp
2020
// compile with: /c
2121
struct A {
@@ -30,4 +30,4 @@ struct B : private A {
3030

3131
int B::vfunc() { return 1; } // C2509
3232
int B::vfunc2() { return 1; } // OK
33-
```
33+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ No version of the function is declared with the specified parameters. Possible
1919

2020
The following sample generates C2511:
2121

22-
```
22+
```cpp
2323
// C2511.cpp
2424
// compile with: /c
2525
class C {
@@ -32,4 +32,4 @@ int C::Func(char *, char *, int i) { // C2511
3232
// int C::Func(char *, char *) {
3333
return 0;
3434
}
35-
```
35+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The type specifier appears in declaration with no variable identifier.
1313

1414
The following sample generates C2513:
1515

16-
```
16+
```cpp
1717
// C2513.cpp
1818
int main() {
1919
int = 9; // C2513
@@ -23,7 +23,7 @@ int main() {
2323

2424
This error can also be generated as a result of a compiler conformance work done for Visual Studio .NET 2003: initialization of a typedef no longer allowed. The initialization of a typedef is not allowed by the standard and now generates a compiler error.
2525

26-
```
26+
```cpp
2727
// C2513b.cpp
2828
// compile with: /c
2929
typedef struct S {
@@ -33,4 +33,4 @@ typedef struct S {
3333
// } S;
3434
```
3535
36-
An alternative would be to delete `typedef` to define a variable with aggregate initializer list, but this is not recommended because it will create a variable with the same name as the type and hide the type name.
36+
An alternative would be to delete `typedef` to define a variable with aggregate initializer list, but this is not recommended because it will create a variable with the same name as the type and hide the type name.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A class must be fully declared before it can be instantiated.
1515

1616
The following sample generates C2514:
1717

18-
```
18+
```cpp
1919
// C2514.cpp
2020
// compile with: /c
2121
class f;
@@ -34,4 +34,4 @@ class fmaker {
3434
return new g(2); // OK
3535
}
3636
};
37-
```
37+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The class is derived from a type name defined by a `typedef` statement.
1313

1414
The following sample generates C2516:
1515

16-
```
16+
```cpp
1717
// C2516.cpp
1818
typedef unsigned long ulong;
1919
class C : public ulong {}; // C2516
20-
```
20+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ The keywords `class` and `struct` should not appear in a base class list.
1313

1414
The following sample generates C2518:
1515

16-
```
16+
```cpp
1717
// C2518.cpp
1818
// compile with: /c
1919
class B {};
2020
class C : public class B {}; // C2518
2121
class D: public B {}; // OK
22-
```
22+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For more information, see [Destructors and finalizers](../../dotnet/how-to-defin
1717

1818
The following sample generates C2521.
1919

20-
```
20+
```cpp
2121
// C2521.cpp
2222
// compile with: /clr
2323
ref class R {
@@ -35,4 +35,4 @@ int main() {
3535
R^ r = gcnew R();
3636
r->CleanUp();
3737
}
38-
```
38+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The name of the destructor must be the class name preceded by a tilde (`~`). The
1313

1414
The following sample generates C2523:
1515

16-
```
16+
```cpp
1717
// C2523.cpp
1818
// compile with: /c
1919
class A {
2020
~B(); // C2523
2121
~A(); // OK
2222
};
23-
```
23+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The destructor or finalizer had a parameter list that is not [void](../../cpp/vo
1515

1616
The following code reproduces C2524.
1717

18-
```
18+
```cpp
1919
// C2524.cpp
2020
// compile with: /c
2121
class A {
@@ -30,7 +30,7 @@ class A {
3030
3131
The following code reproduces C2524.
3232
33-
```
33+
```cpp
3434
// C2524_b.cpp
3535
// compile with: /clr /c
3636
ref struct I1 {
@@ -39,4 +39,4 @@ protected:
3939
// try the following line instead
4040
// !I1();
4141
};
42-
```
42+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ You cannot declare a pointer to a reference. Dereference the variable before dec
1313

1414
The following sample generates C2528:
1515

16-
```
16+
```cpp
1717
// C2528.cpp
1818
int i;
1919
int &ir = i;
2020
int & (*irptr) = ir; // C2528
21-
```
21+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ This error may be fixed by using pointer syntax and declaring a reference to a p
1313

1414
The following sample generates C2529:
1515

16-
```
16+
```cpp
1717
// C2529.cpp
1818
// compile with: /c
1919
int i;
2020
int &ri = i;
2121
int &(&rri) = ri; // C2529
22-
```
22+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ You must initialize a reference when it was declared, unless it is declared alre
2121

2222
The following sample generates C2530:
2323

24-
```
24+
```cpp
2525
// C2530.cpp
2626
int main() {
2727
int i = 0;
2828
int &j; // C2530
2929
int &k = i; // OK
3030
}
31-
```
31+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ References to bit fields are not allowed.
1313

1414
The following sample generates C2531:
1515

16-
```
16+
```cpp
1717
// C2531.cpp
1818
// compile with: /c
1919
class P {
2020
int &b1 : 10; // C2531
2121
int b2 : 10; // OK
2222
};
23-
```
23+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A common source of this error is a missing semicolon between the end of a class
1515

1616
The following sample generates C2533, and shows how to fix it:
1717

18-
```
18+
```cpp
1919
// C2533.cpp
2020
// compile with: /c
2121
class X {
@@ -25,4 +25,4 @@ public:
2525

2626
int X::X() {} // C2533 - constructor return type not allowed
2727
X::X() {} // OK - fix by using no return type
28-
```
28+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ This error may be fixed by removing the `return` statement from the constructor
1515

1616
The following sample generates C2534:
1717

18-
```
18+
```cpp
1919
// C2534.cpp
2020
class A {
2121
public:
2222
int i;
2323
A() { return i; } // C2534
2424
};
25-
```
25+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ If you get C2535 because of the Dispose function, see [Destructors and finalizer
1515

1616
The following sample generates C2535:
1717

18-
```
18+
```cpp
1919
// C2535.cpp
2020
// compile with: /c
2121
class C {
2222
public:
2323
void func(); // forward declaration
2424
void func() {} // C2535
2525
};
26-
```
26+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Possible causes:
1717

1818
The following sample generates C2537:
1919

20-
```
20+
```cpp
2121
// C2537.cpp
2222
// compile with: /c
2323
extern "c" void func(); // C2537
2424
extern "C" void func2(); // OK
25-
```
25+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An array must have a constant bound.
1313

1414
The following sample generates C2540:
1515

16-
```
16+
```cpp
1717
// C2540.cpp
1818
void func(int n, int pC[]) {
1919
int i = ((int [n])pC)[1]; // C2540
@@ -28,4 +28,4 @@ int main() {
2828
func(100, pC);
2929
func2(100, pC);
3030
}
31-
```
31+
```

0 commit comments

Comments
 (0)