Skip to content

Conversation

@Rageking8
Copy link
Contributor

  • Update error message
  • Add new "array of bit fields" scenario as seen on various Stack Overflow questions ([1] [2] [3])
  • Augment the remarks and overhaul the example
  • Add C2531 "See also" link as C2531 is emitted alongside the "reference to bit field" example

Example

// C2033.cpp
// compile with: /c

struct S
{
    int* ptr : 1;     // C2033
    int& ref : 1;     // C2033
    int arr[3] : 1;   // C2033
};
C:\Test>cl /c C2033.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35215 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

C2033.cpp
C2033.cpp(6): error C2033: 'S::ptr': bit field cannot have indirection
C2033.cpp(7): error C2531: 'S::ref': you cannot bind a reference to a bit-field
C2033.cpp(7): error C2033: 'S::ref': bit field cannot have indirection
C2033.cpp(8): error C2033: 'S::arr': bit field cannot have indirection

@prmerger-automator
Copy link
Contributor

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

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 297acdf:

✅ Validation status: passed

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

For more details, please refer to the build report.

@prmerger-automator
Copy link
Contributor

PRMerger Results

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

@v-regandowner
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 10, 2025
@v-dirichards v-dirichards self-assigned this Sep 25, 2025
For clarity, removed example that generates two errors: C2531 and C2033
Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Thank you for adding the extra example and making the explanation richer.
I removed the reference example. It does generate C2033, but it also generates C2531. For clarity, I removed it since it was nosier than the others.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 5dd06e8:

✅ Validation status: passed

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

For more details, please refer to the build report.

@prmerger-automator
Copy link
Contributor

PRMerger Results

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

@TylerMSFT
Copy link
Collaborator

#sign-off

@ttorble ttorble merged commit 3bff02d into MicrosoftDocs:main Dec 8, 2025
2 checks passed
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.

5 participants