Skip to content

Update C2860 #4987

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
Mar 18, 2024
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
12 changes: 6 additions & 6 deletions docs/error-messages/compiler-errors-2/compiler-error-c2860.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
description: "Learn more about: Compiler Error C2860"
title: "Compiler Error C2860"
ms.date: "11/04/2016"
ms.date: "03/16/2024"
f1_keywords: ["C2860"]
helpviewer_keywords: ["C2860"]
ms.assetid: ccc83553-90ed-4e94-b5e9-38b58ae38e31
---
# Compiler Error C2860

'void' cannot be an argument type, except for '(void)'
'void' cannot be used as a function parameter except for '(void)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we prefer using block quotes for the error message, like:

- 'void' cannot be used as a function parameter except for '(void)'
+ > 'void' cannot be used as a function parameter except for '(void)'

How about the usage of Remarks and Example subheaders?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'typical' style for these, for no good reason that I know of other than that's what the rest use, is to avoid block quotes and to not add the ## Example or ## Remarks sections. There are some exceptions if you look around, but they are more the exception than the rule. So we may as well stay with the format most of them are in.


Type **`void`** cannot be used as an argument type with other arguments.
A function parameter cannot be of type **`void`**.

The following sample generates C2860:

```cpp
// C2860.cpp
// compile with: /c
void profunc1(void, int i); // C2860
void func10(void); // OK
void func1(void x); // C2860
void func2(void, int y); // C2860
void func3(void); // OK
```
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The articles in this section of the documentation explain a subset of the error
| [Compiler error C2857](compiler-error-c2857.md) | '#include' statement specified with the /Yc*filename* command-line option was not found in the source file |
| [Compiler error C2858](compiler-error-c2858.md) | command-line option '/Yc (/Fd*filename*)' inconsistent with precompiled header, which used '/Fd*filename*' (Obsolete in Visual Studio 2022.) |
| [Compiler error C2859](compiler-error-c2859.md) | *filename* is not the *filetype* file that was used when this precompiled header was created, recreate the precompiled header. |
| [Compiler error C2860](compiler-error-c2860.md) | 'void' cannot be an argument type, except for '(void)' |
| [Compiler error C2860](compiler-error-c2860.md) | 'void' cannot be used as a function parameter except for '(void)' |
| [Compiler error C2861](compiler-error-c2861.md) | '*declaration*': an interface member function cannot be defined |
| [Compiler error C2862](compiler-error-c2862.md) | '*interface*': an interface can only have public members |
| [Compiler error C2863](compiler-error-c2863.md) | '*interface*': an interface cannot have friends |
Expand Down