Skip to content

Remove superfluous semicolons after function definition #5393

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
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/cpp/function-overloading.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Function Overloading"
title: "Function Overloading"
description: "Learn more about: Function Overloading"
ms.date: 02/01/2023
helpviewer_keywords: ["function overloading [C++], about function overloading", "function overloading", "declaring functions [C++], overloading"]
---
Expand Down Expand Up @@ -307,7 +307,7 @@ public:

void Print( int i )
{
};
}

UDC udc;

Expand Down
7 changes: 3 additions & 4 deletions docs/cpp/overload-resolution-of-function-template-calls.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Overload resolution of function template calls"
title: "Overload resolution of function template calls"
description: "Learn more about: Overload resolution of function template calls"
ms.date: 09/27/2022
helpviewer_keywords: ["function templates overload resolution"]
ms.assetid: a2918748-2cbb-4fc6-a176-e256f120bee4
---
# Overload resolution of function template calls

Expand All @@ -26,7 +25,7 @@ template <class T1, class T2>
void f(T1, T2)
{
cout << "void f(T1, T2)" << endl;
};
}

int main()
{
Expand Down Expand Up @@ -58,7 +57,7 @@ template <class T1, class T2>
void f(T1, T2)
{
cout << "void f(T1, T2)" << endl;
};
}

int main()
{
Expand Down
4 changes: 2 additions & 2 deletions docs/dotnet/how-to-access-characters-in-a-system-string.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "How to: Access Characters in a System::String"
description: "Learn more about: How to: Access Characters in a System::String"
ms.date: 11/04/2016
ms.custom: "get-started-article"
ms.date: "11/04/2016"
helpviewer_keywords: ["characters [C++], accessing in System::String", "examples [C++], strings", "strings [C++], accessing characters"]
---
# How to: Access Characters in a System::String
Expand Down Expand Up @@ -53,7 +53,7 @@ size_t getlen(System::String ^ s) {
// make sure it doesn't move during the unmanaged call
pin_ptr<const wchar_t> pinchars = PtrToStringChars(s);
return wcsnlen(pinchars, maxsize);
};
}

int main() {
System::Console::WriteLine(getlen("testing"));
Expand Down
7 changes: 3 additions & 4 deletions docs/dotnet/how-to-define-and-use-delegates-cpp-cli.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: How to: Define and Use Delegates (C++/CLI)"
title: "How to: Define and Use Delegates (C++/CLI)"
ms.date: "11/04/2016"
description: "Learn more about: How to: Define and Use Delegates (C++/CLI)"
ms.date: 11/04/2016
helpviewer_keywords: ["delegates"]
ms.assetid: 1cdf3420-89c1-47c0-b796-aa984020e0f8
---
# How to: Define and Use Delegates (C++/CLI)

Expand Down Expand Up @@ -442,7 +441,7 @@ int main() {
Del^ d = gcnew Del(r1, &R::f);
d += gcnew Del(&R::f);
d(r2);
};
}
```

**Output**
Expand Down
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-1/compiler-error-c2134.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following sample generates C2134:
// compile with: /c
int A() {
return 42;
};
}

constexpr int B() {
return A(); // Error C2134: 'A': call does not result in a constant expression.
Expand All @@ -31,7 +31,7 @@ Possible resolution:
// C2134b.cpp
constexpr int A() { // add constexpr to A, since it meets the requirements of constexpr.
return 42;
};
}

constexpr int B() {
return A(); // No error
Expand Down
9 changes: 4 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c2835.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2835"
title: "Compiler Error C2835"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2835"
ms.date: 11/04/2016
f1_keywords: ["C2835"]
helpviewer_keywords: ["C2835"]
ms.assetid: 41c70630-983f-4da2-8342-513cf48b0519
---
# Compiler Error C2835

Expand All @@ -22,12 +21,12 @@ public:

A() {
v_char = 'A';
};
}
operator char(char a) { // C2835
// try the following line instead
// operator char() {
return v_char + 1;
};
}
};

int main() {
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3185.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3185"
title: "Compiler Error C3185"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3185"
ms.date: 11/04/2016
f1_keywords: ["C3185"]
helpviewer_keywords: ["C3185"]
ms.assetid: 5bf96279-043c-4981-9d02-b4550071b192
---
# Compiler Error C3185

Expand All @@ -25,5 +24,5 @@ int main() {
Base ^pb = pd;
const type_info & t1 = typeid(pb); // C3185
System::Type ^ MyType = Base::typeid; // OK
};
}
```
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3536.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3536"
title: "Compiler Error C3536"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3536"
ms.date: 11/04/2016
f1_keywords: ["C3536"]
helpviewer_keywords: ["C3536"]
ms.assetid: 8d866075-866b-49eb-9979-ee27b308f7e3
---
# Compiler Error C3536

Expand All @@ -31,7 +30,7 @@ int main()
auto* d = &d; //C3536
auto& e = e; //C3536
return 0;
};
}
```

## See also
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3672.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3672"
title: "Compiler Error C3672"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3672"
ms.date: 11/04/2016
f1_keywords: ["C3672"]
helpviewer_keywords: ["C3672"]
ms.assetid: da971041-1766-467a-aecf-1d8655c6cb7a
---
# Compiler Error C3672

Expand All @@ -22,7 +21,7 @@ template<typename T>
void f(T* pT) {
&pT->T::~T; // C3672
pT->T::~T(); // OK
};
}

int main() {
int i;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 1) C4269"
title: "Compiler Warning (level 1) C4269"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 1) C4269"
ms.date: 11/04/2016
f1_keywords: ["C4269"]
helpviewer_keywords: ["C4269"]
ms.assetid: 96c97bbc-068a-4b65-8cd8-4ed5dca04c15
---
# Compiler Warning (level 1) C4269

Expand All @@ -24,7 +23,7 @@ public:

void g() {
const X x1; // C4269
};
}
```

Since this instance of the class is generated on the stack, the initial value of `m_data` can be anything. Also, since it is a **`const`** instance, the value of `m_data` can never be changed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: Compiler Warning (level 3, off) C4191"
title: "Compiler Warning (level 3, off) C4191"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 3, off) C4191"
ms.date: 11/04/2016
f1_keywords: ["C4191"]
helpviewer_keywords: ["C4191"]
---
Expand Down Expand Up @@ -46,5 +46,5 @@ int main() {

fnptr1 fp3 = (fnptr1) &f2; // C4191
fnptr2 fp4 = (fnptr2) &f1; // C4191
};
}
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 3) C4243"
title: "Compiler Warning (level 3) C4243"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 3) C4243"
ms.date: 11/04/2016
f1_keywords: ["C4243"]
helpviewer_keywords: ["C4243"]
ms.assetid: ca72f9ad-ce0b-43a9-a68c-106e1f8b90ef
---
# Compiler Warning (level 3) C4243

Expand All @@ -21,7 +20,7 @@ The following sample generates C4243:
struct B {
int f() {
return 0;
};
}
};

struct D : private B {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Warning (level 4) C4205"
title: "Compiler Warning (level 4) C4205"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 4) C4205"
ms.date: 11/04/2016
f1_keywords: ["C4205"]
helpviewer_keywords: ["C4205"]
ms.assetid: 39b5108c-7230-41b4-b2fe-2293eb6aae28
---
# Compiler Warning (level 4) C4205

Expand All @@ -20,7 +19,7 @@ With Microsoft extensions (/Ze), **`static`** functions can be declared inside a
void func1()
{
static int func2(); // C4205
};
}

int main()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: Compiler Warning (level 4, off) C4254"
title: "Compiler Warning (level 4, off) C4254"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Warning (level 4, off) C4254"
ms.date: 11/04/2016
f1_keywords: ["C4254"]
helpviewer_keywords: ["C4254"]
---
Expand Down Expand Up @@ -31,5 +31,5 @@ int main() {
x->a = 4;
x->a = x->b; // OK
x->b = x->a; // C4254
};
}
```
11 changes: 5 additions & 6 deletions docs/error-messages/tool-errors/linker-tools-error-lnk2020.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Linker Tools Error LNK2020"
title: "Linker Tools Error LNK2020"
ms.date: "11/04/2016"
description: "Learn more about: Linker Tools Error LNK2020"
ms.date: 11/04/2016
f1_keywords: ["LNK2020"]
helpviewer_keywords: ["LNK2020"]
ms.assetid: 4dd017d0-5e83-471b-ac8a-538ac1ed6870
---
# Linker Tools Error LNK2020

Expand Down Expand Up @@ -47,16 +46,16 @@ The following sample generates LNK2020.

template <typename T>
ref struct Base {
virtual void f1() {};
virtual void f1() {}
};

template <typename T>
ref struct Base2 {
virtual void f1() {};
virtual void f1() {}
};

int main() {
Base<int>^ p; // LNK2020
Base2<int>^ p2 = gcnew Base2<int>(); // OK
};
}
```
7 changes: 3 additions & 4 deletions docs/error-messages/tool-errors/linker-tools-error-lnk2033.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Linker Tools Error LNK2033"
title: "Linker Tools Error LNK2033"
ms.date: "11/04/2016"
description: "Learn more about: Linker Tools Error LNK2033"
ms.date: 11/04/2016
f1_keywords: ["LNK2033"]
helpviewer_keywords: ["LNK2033"]
ms.assetid: d61db467-9328-4788-bf54-e2a20537f13f
---
# Linker Tools Error LNK2033

Expand Down Expand Up @@ -32,5 +31,5 @@ ref class B {};
int main() {
A ^ aa = nullptr;
B ^ bb = nullptr; // OK
};
}
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: How to: Declare Interior Pointers with the const Keyword (C++/CLI)"
title: "How to: Declare Interior Pointers with the const Keyword (C++/CLI)"
ms.date: "10/12/2018"
description: "Learn more about: How to: Declare Interior Pointers with the const Keyword (C++/CLI)"
ms.date: 10/12/2018
ms.topic: "reference"
helpviewer_keywords: ["pointers, interior"]
ms.assetid: 64e08b0e-9396-4046-ab51-8f6588f32330
---
# How to: Declare Interior Pointers with the const Keyword (C++/CLI)

Expand Down Expand Up @@ -69,7 +68,7 @@ int main() {
G ^ const h_G2 = gcnew G; // interior pointers to this object cannot be dereferenced and changed
h_G2->msg = "test";
interior_ptr<String^ const> int_ptr_G2 = &(h_G->msg);
};
}
```

## See also
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: How to: Overload Functions with Interior Pointers and Native Pointers (C++/CLI)"
title: "How to: Overload Functions with Interior Pointers and Native Pointers (C++/CLI)"
ms.date: "10/12/2018"
description: "Learn more about: How to: Overload Functions with Interior Pointers and Native Pointers (C++/CLI)"
ms.date: 10/12/2018
ms.topic: "reference"
helpviewer_keywords: ["Functions with interior and native pointers, overloading"]
ms.assetid: d70df625-4aad-457c-84f5-70a0a290cc1f
---
# How to: Overload Functions with Interior Pointers and Native Pointers (C++/CLI)

Expand Down Expand Up @@ -49,7 +48,7 @@ int main() {
G ^pG = gcnew G; // common language runtime heap
f( &pS->i );
f( &pG->i );
};
}
```

```Output
Expand Down
Loading