Skip to content

Conversation

Rageking8
Copy link
Contributor

Update error message, fix defunct example, and update ms.date metadata.

Example: inline int

Old example that no longer generates C2735:

// C2735.cpp
void f(inline int){}   // C7643
Visual Studio 2022
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35216 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(2): error C7643: 'unnamed-parameter': 'inline' specifier cannot appear on a function parameter
Visual Studio 2026 Insiders
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35503 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(2): error C7643: 'unnamed-parameter': 'inline' specifier cannot appear on a function parameter

Example: virtual int

New example that generates C2735. Tested practically all other keywords and it seems only virtual emits it.

// C2735.cpp
// compile with: /c

void func(virtual int) {}   // C2735
Visual Studio 2022
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35216 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(4): error C2735: 'virtual' keyword is not permitted in formal parameter type specifier
Visual Studio 2026 Insiders
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35503 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(4): error C2735: 'virtual' keyword is not permitted in formal parameter type specifier

Example: virtual int i

Tried adding an identifier for the parameter, but that changes the error emitted:

// C2735.cpp
// compile with: /c

void func(virtual int i) {}   // C2433
Visual Studio 2022
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35216 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(4): error C2433: 'i': 'virtual' not permitted on data declarations
Visual Studio 2026 Insiders
C:\Test>cl /c C2735.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35503 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2735.cpp
C2735.cpp(4): error C2433: 'i': 'virtual' not permitted on data declarations

Copy link
Contributor

@Rageking8 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit 5bdc1c7:

✅ Validation status: passed

File Status Preview URL Details
docs/error-messages/compiler-errors-2/compiler-error-c2735.md ✅Succeeded

For more details, please refer to the build report.

Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

@v-dirichards
Copy link
Contributor

@TylerMSFT

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label Sep 12, 2025
@TylerMSFT
Copy link
Collaborator

Very nice - thank you.
#sign-off

@v-regandowner v-regandowner merged commit 032e1ee into MicrosoftDocs:main Sep 22, 2025
2 checks passed
@Rageking8 Rageking8 deleted the fix-defunct-example-and-update-c2735-error-reference branch September 22, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants