Skip to content

register declaration applied to member of a cbuffer should be an error #7638

Open

Description

@Maraneshi

Description
You can apply bogus register declarations on members of a cbuffer as long as they correspond to the legacy constant registers, i.e. b#, c# or i#. Register spaces can be applied too.

Steps to Reproduce
https://hlsl.godbolt.org/z/5vr9xEd66

Actual Behavior
All of these do nothing and make no logical sense, but are accepted by DXC and emit no diagnostics at all.
Clang does error on almost all of them (with different reasons depending on register type), except if you only supply register space.

Environment

  • DXC version: 1.6+
  • Host Operating System: All

Activity

  1. added
    bug
    needs-triage
    on Jul 10, 2025
  2. added
    diagnostic
    and removed
    needs-triage
    on Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdiagnostic

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions