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

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 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.

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
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.

3 participants