Skip to content

[HLSL] Initializer lists for incomplete arrays failing #132958

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

Closed
llvm-beanz opened this issue Mar 25, 2025 · 1 comment · Fixed by #133508
Closed

[HLSL] Initializer lists for incomplete arrays failing #132958

llvm-beanz opened this issue Mar 25, 2025 · 1 comment · Fixed by #133508
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

llvm-beanz commented Mar 25, 2025

Initialization of incomplete arrays fail because the size of the entity to initialize is undefined which trips over how we iterate the initializers. I need to create an alternate flow to support repeatedly iterating the dest types list to handle unknown array sizes.

Problematic code:

export void fn() {
    int2 Arr[] = {int2(0,1), int2(2,3), int2(4,5)};
}

Compiler Explorer

@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label Mar 25, 2025
@llvm-beanz llvm-beanz moved this to Active in HLSL Support Mar 25, 2025
@llvm-beanz llvm-beanz self-assigned this Mar 25, 2025
@llvm-beanz llvm-beanz changed the title [HLSL] Initializer lists for some arrays failing [HLSL] Initializer lists for incomplete arrays failing Mar 26, 2025
llvm-beanz added a commit to llvm-beanz/llvm-project that referenced this issue Mar 28, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes llvm#132958

../clang/test/SemaHLSL/Language/InitIncompleteArrays.hlsl
llvm-beanz added a commit that referenced this issue Apr 25, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes #132958
@github-project-automation github-project-automation bot moved this from Active to Closed in HLSL Support Apr 25, 2025
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Apr 25, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2025

@llvm/issue-subscribers-clang-frontend

Author: Chris B (llvm-beanz)

Initialization of incomplete arrays fail because the size of the entity to initialize is undefined which trips over how we iterate the initializers. I need to create an alternate flow to support repeatedly iterating the dest types list to handle unknown array sizes.

Problematic code:

export void fn() {
    int2 Arr[] = {int2(0,1), int2(2,3), int2(4,5)};
}

Compiler Explorer

IanWood1 pushed a commit to IanWood1/llvm-project that referenced this issue May 6, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes llvm#132958
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this issue May 6, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes llvm#132958
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this issue May 6, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes llvm#132958
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this issue May 9, 2025
This refactors the initialization list transformation code to handle
incomplete array types.

Fixes llvm#132958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants