Skip to content

Add language identifiers #1755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2500.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A class cannot be specified as a direct base class more than once. A class can b

The following sample generates C2500:

```
```cpp
// C2500.cpp
// compile with: /c
class A {};
Expand All @@ -27,4 +27,4 @@ class B : public A, public A {}; // C2500
class C : public A {};
class D : public A {};
class E : public C, public D {};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2502.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The base class has more than one access modifier. Only one access modifier (`pub

The following sample generates C2502:

```
```cpp
// C2502.cpp
// compile with: /c
class A { };
Expand All @@ -23,4 +23,4 @@ class C : private public A { }; // C2502
// OK
class D : private A {};
class E : public A, private B {};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2503.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A base class or structure contains a zero-sized array. An array in a class must

The following sample generates C2503:

```
```cpp
// C2503.cpp
// compile with: /c
class A {
Expand All @@ -29,4 +29,4 @@ public:
};

class D : C {};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2504.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The base class is declared but never defined. Possible causes:

The following sample generates C2504:

```
```cpp
// C2504.cpp
// compile with: /c
class A;
Expand All @@ -29,4 +29,4 @@ class B : public A {}; // C2504
```
class C{};
class D : public C {};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2505.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For more information, see [appdomain](../../cpp/appdomain.md) and [process](../.

The following sample generates C2505:

```
```cpp
// C2505.cpp
// compile with: /clr

Expand All @@ -27,4 +27,4 @@ int main() {
__declspec(process) int i; // C2505
__declspec(appdomain) int j; // C2505
}
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2506.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ See [appdomain](../../cpp/appdomain.md) for more information.

The following sample generates C2506.

```
```cpp
// C2506.cpp
// compile with: /clr /c
ref struct R {
__declspec(process) static int n; // C2506
int o; // OK
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2507.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ A class or structure is declared as `virtual` more than once. Only one `virtual`

The following sample generates C2507:

```
```cpp
// C2507.cpp
// compile with: /c
class A {};
class B : virtual virtual public A {}; // C2507
class C : virtual public A {}; // OK
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2509.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The function is not declared in the specified class.

The following sample generates C2509.

```
```cpp
// C2509.cpp
// compile with: /c
struct A {
Expand All @@ -30,4 +30,4 @@ struct B : private A {

int B::vfunc() { return 1; } // C2509
int B::vfunc2() { return 1; } // OK
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2511.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ No version of the function is declared with the specified parameters. Possible

The following sample generates C2511:

```
```cpp
// C2511.cpp
// compile with: /c
class C {
Expand All @@ -32,4 +32,4 @@ int C::Func(char *, char *, int i) { // C2511
// int C::Func(char *, char *) {
return 0;
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-2/compiler-error-c2513.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The type specifier appears in declaration with no variable identifier.

The following sample generates C2513:

```
```cpp
// C2513.cpp
int main() {
int = 9; // C2513
Expand All @@ -23,7 +23,7 @@ int main() {

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.

```
```cpp
// C2513b.cpp
// compile with: /c
typedef struct S {
Expand All @@ -33,4 +33,4 @@ typedef struct S {
// } S;
```

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.
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.
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2514.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A class must be fully declared before it can be instantiated.

The following sample generates C2514:

```
```cpp
// C2514.cpp
// compile with: /c
class f;
Expand All @@ -34,4 +34,4 @@ class fmaker {
return new g(2); // OK
}
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2516.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ The class is derived from a type name defined by a `typedef` statement.

The following sample generates C2516:

```
```cpp
// C2516.cpp
typedef unsigned long ulong;
class C : public ulong {}; // C2516
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2518.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ The keywords `class` and `struct` should not appear in a base class list.

The following sample generates C2518:

```
```cpp
// C2518.cpp
// compile with: /c
class B {};
class C : public class B {}; // C2518
class D: public B {}; // OK
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2521.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For more information, see [Destructors and finalizers](../../dotnet/how-to-defin

The following sample generates C2521.

```
```cpp
// C2521.cpp
// compile with: /clr
ref class R {
Expand All @@ -35,4 +35,4 @@ int main() {
R^ r = gcnew R();
r->CleanUp();
}
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2523.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ The name of the destructor must be the class name preceded by a tilde (`~`). The

The following sample generates C2523:

```
```cpp
// C2523.cpp
// compile with: /c
class A {
~B(); // C2523
~A(); // OK
};
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-2/compiler-error-c2524.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The destructor or finalizer had a parameter list that is not [void](../../cpp/vo

The following code reproduces C2524.

```
```cpp
// C2524.cpp
// compile with: /c
class A {
Expand All @@ -30,7 +30,7 @@ class A {

The following code reproduces C2524.

```
```cpp
// C2524_b.cpp
// compile with: /clr /c
ref struct I1 {
Expand All @@ -39,4 +39,4 @@ protected:
// try the following line instead
// !I1();
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2528.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ You cannot declare a pointer to a reference. Dereference the variable before dec

The following sample generates C2528:

```
```cpp
// C2528.cpp
int i;
int &ir = i;
int & (*irptr) = ir; // C2528
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2529.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This error may be fixed by using pointer syntax and declaring a reference to a p

The following sample generates C2529:

```
```cpp
// C2529.cpp
// compile with: /c
int i;
int &ri = i;
int &(&rri) = ri; // C2529
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2530.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ You must initialize a reference when it was declared, unless it is declared alre

The following sample generates C2530:

```
```cpp
// C2530.cpp
int main() {
int i = 0;
int &j; // C2530
int &k = i; // OK
}
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2531.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ References to bit fields are not allowed.

The following sample generates C2531:

```
```cpp
// C2531.cpp
// compile with: /c
class P {
int &b1 : 10; // C2531
int b2 : 10; // OK
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2533.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A common source of this error is a missing semicolon between the end of a class

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

```
```cpp
// C2533.cpp
// compile with: /c
class X {
Expand All @@ -25,4 +25,4 @@ public:

int X::X() {} // C2533 - constructor return type not allowed
X::X() {} // OK - fix by using no return type
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2534.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ This error may be fixed by removing the `return` statement from the constructor

The following sample generates C2534:

```
```cpp
// C2534.cpp
class A {
public:
int i;
A() { return i; } // C2534
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2535.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ If you get C2535 because of the Dispose function, see [Destructors and finalizer

The following sample generates C2535:

```
```cpp
// C2535.cpp
// compile with: /c
class C {
public:
void func(); // forward declaration
void func() {} // C2535
};
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2537.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Possible causes:

The following sample generates C2537:

```
```cpp
// C2537.cpp
// compile with: /c
extern "c" void func(); // C2537
extern "C" void func2(); // OK
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c2540.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ An array must have a constant bound.

The following sample generates C2540:

```
```cpp
// C2540.cpp
void func(int n, int pC[]) {
int i = ((int [n])pC)[1]; // C2540
Expand All @@ -28,4 +28,4 @@ int main() {
func(100, pC);
func2(100, pC);
}
```
```
Loading