Skip to content

Remove more superfluous semicolons after function definition #5521

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/atl/codesnippet/CPP/atl-collection-classes_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MyTraits : public CElementTraits< MyData >
return true;
else
return false;
};
}
};

void DoAtlCustomTraitsList()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
description: "Learn more about: _get_purecall_handler, _set_purecall_handler"
title: "_get_purecall_handler, _set_purecall_handler"
ms.date: "1/14/2021"
description: "Learn more about: _get_purecall_handler, _set_purecall_handler"
ms.date: 1/14/2021
api_name: ["_set_purecall_handler", "_set_purecall_handler_m", "_get_purecall_handler"]
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll"]
api_type: ["DLLExport"]
topic_type: ["apiref"]
f1_keywords: ["_set_purecall_handler", "_set_purecall_handler_m", "set_purecall_handler_m", "set_purecall_handler", "stdlib/_set_purecall_handler", "stdlib/_get_purecall_handler", "_get_purecall_handler"]
helpviewer_keywords: ["_set_purecall_handler function", "set_purecall_handler function", "purecall_handler", "set_purecall_handler_m function", "_purecall_handler", "_set_purecall_handler_m function", "_get_purecall_handler function"]
ms.assetid: 2759b878-8afa-4129-86e7-72afc2153d9c
---
# `_get_purecall_handler`, `_set_purecall_handler`

Expand Down Expand Up @@ -64,7 +63,7 @@ class CDerived;
class CBase
{
public:
CBase(CDerived *derived): m_pDerived(derived) {};
CBase(CDerived *derived): m_pDerived(derived) {}
~CBase();
virtual void function(void) = 0;

Expand All @@ -74,8 +73,8 @@ public:
class CDerived : public CBase
{
public:
CDerived() : CBase(this) {}; // C4355
virtual void function(void) {};
CDerived() : CBase(this) {} // C4355
virtual void function(void) {}
};

CBase::~CBase()
Expand Down
7 changes: 3 additions & 4 deletions docs/code-quality/c28208.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Warning C28208"
title: Warning C28208
description: "Learn more about: Warning C28208"
ms.date: 10/03/2022
f1_keywords: ["C28208", "FUNCTION_TYPE_REDECLARATION", "__WARNING_FUNCTION_TYPE_REDECLARATION"]
helpviewer_keywords: ["C28208"]
ms.assetid: e9a8ce37-3b05-4202-b078-5570ae496d1d
---
# Warning C28208

Expand All @@ -30,8 +29,8 @@ typedef void test_type(void*);
#include "c28208_example.h"
test_type my_test1;
test_type my_test2;
void my_test1(int* x){}; // Generates C28208
void my_test2(void* x){}; // Doesn't generate C28208
void my_test1(int* x){} // Generates C28208
void my_test2(void* x){} // Doesn't generate C28208

int main()
{
Expand Down
9 changes: 4 additions & 5 deletions docs/cpp/class-templates.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Class Templates"
title: "Class Templates"
description: "Learn more about: Class Templates"
ms.date: 06/30/2022
helpviewer_keywords: ["classes [C++], operating on type", "class templates", "templates, class templates"]
ms.assetid: 633a53c8-24ee-4c23-8c88-e7c3cb0b7ac3
---
# Class Templates

Expand All @@ -28,15 +27,15 @@ public:

template< class T, int i > MyStack< T, i >::MyStack( void )
{
};
}

template< class T, int i > void MyStack< T, i >::push( const T item )
{
};
}

template< class T, int i > T& MyStack< T, i >::pop( void )
{
};
}

int main()
{
Expand Down
8 changes: 4 additions & 4 deletions docs/cpp/decltype-cpp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: decltype (C++)"
title: "decltype (C++)"
description: "Learn more about: decltype (C++)"
ms.date: 09/14/2023
f1_keywords: ["decltype_cpp"]
helpviewer_keywords: ["operators [C++], decltype", "decltype operator", "operators [C++], type of an expression", "operators [C++], deduce expression type"]
Expand Down Expand Up @@ -60,7 +60,7 @@ In C++11, you can use the **`decltype`** type specifier on a trailing return typ

```cpp
template<typename T, typename U>
UNKNOWN func(T&& t, U&& u){ return t + u; };
UNKNOWN func(T&& t, U&& u){ return t + u; }
```

The introduction of the **`decltype`** type specifier enables a developer to obtain the type of the expression that the function template returns. Use the *alternative function declaration syntax* that is shown later, the **`auto`** keyword, and the **`decltype`** type specifier to declare a *late-specified* return type. The late-specified return type is determined when the declaration is compiled, instead of when it's coded.
Expand All @@ -75,12 +75,12 @@ In the following code example, the late-specified return type of the `myFunc` fu
//C++11
template<typename T, typename U>
auto myFunc(T&& t, U&& u) -> decltype (forward<T>(t) + forward<U>(u))
{ return forward<T>(t) + forward<U>(u); };
{ return forward<T>(t) + forward<U>(u); }

//C++14
template<typename T, typename U>
decltype(auto) myFunc(T&& t, U&& u)
{ return forward<T>(t) + forward<U>(u); };
{ return forward<T>(t) + forward<U>(u); }
```

## `decltype` and forwarding functions (C++11)
Expand Down
7 changes: 3 additions & 4 deletions docs/cpp/explicit-specialization-of-function-templates.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Explicit Specialization of Function Templates"
title: "Explicit Specialization of Function Templates"
ms.date: "11/04/2016"
description: "Learn more about: Explicit Specialization of Function Templates"
ms.date: 11/04/2016
helpviewer_keywords: ["overriding, functions", "function templates, specialization", "explicit specialization of function templates", "declaring functions [C++], specialization of function template", "specialization of function templates"]
ms.assetid: eb0fcb73-eaed-42a1-9b83-14b055a34bf8
---
# Explicit Specialization of Function Templates

Expand All @@ -21,7 +20,7 @@ This declaration enables you to define a different function for **`double`** var
// explicit_specialization.cpp
template<class T> void f(T t)
{
};
}

// Explicit specialization of f with 'char' with the
// template argument explicitly specified:
Expand Down
6 changes: 3 additions & 3 deletions docs/cpp/explicitly-defaulted-and-deleted-functions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: Explicitly Defaulted and Deleted Functions"
title: "Explicitly Defaulted and Deleted Functions"
ms.date: "11/04/2016"
description: "Learn more about: Explicitly Defaulted and Deleted Functions"
ms.date: 11/04/2016
---
# Explicitly Defaulted and Deleted Functions

Expand Down Expand Up @@ -44,7 +44,7 @@ These rules can complicate the implementation of what should be straight-forward
```cpp
struct noncopyable
{
noncopyable() {};
noncopyable() {}

private:
noncopyable(const noncopyable&);
Expand Down
6 changes: 3 additions & 3 deletions docs/cpp/initializers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Initializers"
ms.date: "07/29/2019"
description: "How to initialize classes, structs, arrays and fundamental types in C++."
ms.date: 07/29/2019
helpviewer_keywords: ["arrays [C++], array-element initializers", "aggregate initializers [C++]"]
---
# Initializers
Expand Down Expand Up @@ -51,8 +51,8 @@ Initializers may take these forms:
};
class PointConsumer{
public:
void set_point(Point p){};
void set_points(initializer_list<Point> my_list){};
void set_point(Point p){}
void set_points(initializer_list<Point> my_list){}
};
int main() {
PointConsumer pc{};
Expand Down
7 changes: 3 additions & 4 deletions docs/cpp/safebuffers.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: safebuffers"
title: "safebuffers"
ms.date: "11/04/2016"
description: "Learn more about: safebuffers"
ms.date: 11/04/2016
f1_keywords: ["safebuffers_cpp"]
helpviewer_keywords: ["__declspec keyword (C++), safebuffers", "safebuffers __declspec keyword"]
ms.assetid: 0b0dce14-4523-44d2-8070-5dd0fdabc618
---
# safebuffers

Expand Down Expand Up @@ -50,7 +49,7 @@ static int checkBuffers() {
BUFFER cb;
// Use the buffer...
return 0;
};
}
static __declspec(safebuffers)
int noCheckBuffers() {
BUFFER ncb;
Expand Down
7 changes: 3 additions & 4 deletions docs/cpp/selectany.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: `selectany`"
title: "selectany"
ms.date: "11/04/2016"
description: "Learn more about: `selectany`"
ms.date: 11/04/2016
f1_keywords: ["selectany_cpp"]
helpviewer_keywords: ["__declspec keyword [C++], selectany", "selectany __declspec keyword"]
ms.assetid: 9c353017-5a42-4f50-b741-bd13da1ce84d
---
# `selectany`

Expand Down Expand Up @@ -56,7 +55,7 @@ extern __declspec(selectany) int x5;
// OK: dynamic initialization of global object
class X {
public:
X(int i){i++;};
X(int i){i++;}
int i;
};

Expand Down
7 changes: 3 additions & 4 deletions docs/cpp/single-inheritance.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Single Inheritance"
title: "Single Inheritance"
ms.date: "11/19/2018"
description: "Learn more about: Single Inheritance"
ms.date: 11/19/2018
helpviewer_keywords: ["single inheritance", "base classes [C++], indirect", "scope, scope resolution operator", "operators [C++], scope resolution", "scope resolution operator", "derived classes [C++], single base class", "inheritance, single"]
ms.assetid: 1cb946ed-8b1b-4cf1-bde0-d9cecbfdc622
---
# Single Inheritance

Expand Down Expand Up @@ -74,7 +73,7 @@ Book::Book( char *name, long pagecount ) {
Name = new char[ strlen( name ) + 1 ];
strcpy_s( Name, strlen(Name), name );
PageCount = pagecount;
};
}
```

Note that the constructor for `Book`, (`Book::Book`), has access to the data member, `Name`. In a program, an object of type `Book` can be created and used as follows:
Expand Down
4 changes: 2 additions & 2 deletions docs/cppcx/platform-object-class.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Platform::Object Class"
description: "Learn more about: Platform::Object Class"
ms.date: "12/30/2016"
ms.date: 12/30/2016
ms.topic: "reference"
f1_keywords: ["VCCORLIB/Platform::Object::Object", "VCCORLIB/Platform::Object::Equals", "VCCORLIB/Platform::Object::GetHashCode", "VCCORLIB/Platform::Object::ReferenceEquals", "VCCORLIB/Platform::ToString", "VCCORLIB/Platform::GetType"]
helpviewer_keywords: ["Object class"]
Expand Down Expand Up @@ -166,7 +166,7 @@ public:
virtual Platform::String^ ToString() override
{
return "I'm a Tree";
};
}
};
```

Expand Down
9 changes: 4 additions & 5 deletions docs/dotnet/double-thunking-cpp.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: Double Thunking (C++)"
title: "Double Thunking (C++)"
ms.date: "11/04/2016"
description: "Learn more about: Double Thunking (C++)"
ms.date: 11/04/2016
helpviewer_keywords: ["double thunks", "interop [C++], double thunking", "mixed assemblies [C++], double thunking", "/clr compiler option [C++], double thunking", "interoperability [C++], double thunking"]
ms.assetid: a85090b2-dc3c-498a-b40c-340db229dd6f
ms.topic: how-to
---
# Double Thunking (C++)
Expand Down Expand Up @@ -52,7 +51,7 @@ struct T {
};

struct S {
virtual void /* __clrcall */ f(T t) {};
virtual void /* __clrcall */ f(T t) {}
} s;

int main() {
Expand Down Expand Up @@ -101,7 +100,7 @@ struct T {
};

struct S {
virtual void /* __clrcall */ f(T t) {};
virtual void /* __clrcall */ f(T t) {}
} s;

int main() {
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-1/compiler-error-c2246.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2246"
title: "Compiler Error C2246"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2246"
ms.date: 11/04/2016
f1_keywords: ["C2246"]
helpviewer_keywords: ["C2246"]
ms.assetid: 4f3e4f83-21f3-4256-af96-43e0bb060311
---
# Compiler Error C2246

Expand All @@ -20,5 +19,5 @@ The following sample generates C2246:
void func( void ) {
class A { static int i; }; // C2246 i is local to func
static int j; // OK
};
}
```
9 changes: 4 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2249.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2249"
title: "Compiler Error C2249"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2249"
ms.date: 11/04/2016
f1_keywords: ["C2249"]
helpviewer_keywords: ["C2249"]
ms.assetid: bdd6697c-e04b-49b9-8e40-d9eb6d74f2b6
---
# Compiler Error C2249

Expand All @@ -20,9 +19,9 @@ The following sample generates C2249.
// C2249.cpp
class A {
private:
void privFunc( void ) {};
void privFunc( void ) {}
public:
void pubFunc( void ) {};
void pubFunc( void ) {}
};

class B : virtual public A {} b;
Expand Down
9 changes: 4 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2254.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2254"
title: "Compiler Error C2254"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2254"
ms.date: 11/04/2016
f1_keywords: ["C2254"]
helpviewer_keywords: ["C2254"]
ms.assetid: 49bb3d7e-3bdf-4af6-937c-fa627be412a9
---
# Compiler Error C2254

Expand All @@ -24,6 +23,6 @@ public:
friend void func3(); // OK, friend not virtual nor pure
};

void func1() {};
void func3() {};
void func1() {}
void func3() {}
```
9 changes: 4 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c2614.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C2614"
title: "Compiler Error C2614"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2614"
ms.date: 11/04/2016
f1_keywords: ["C2614"]
helpviewer_keywords: ["C2614"]
ms.assetid: a550c1d5-8718-4e17-a888-b2619e00fe11
---
# Compiler Error C2614

Expand All @@ -21,12 +20,12 @@ The following sample generates C2614.
// compile with: /c
struct A {
int i;
A( int ia ) : B( i ) {}; // C2614 B is not a member of A
A( int ia ) : B( i ) {} // C2614 B is not a member of A
};

struct A2 {
int B;
int i;
A2( int ia ) : B( i ) {}; // OK
A2( int ia ) : B( i ) {} // OK
};
```
Loading