Skip to content

Accept empty aggregate initializers when emulating clang versions before 17 [] - #235

Open
jketema wants to merge 1 commit into
edgcpp:mainfrom
jketema:clang-scalar
Open

jketema wants to merge 1 commit into
edgcpp:mainfrom
jketema:clang-scalar

Conversation

@jketema

@jketema jketema commented Oct 7, 2026

Copy link
Copy Markdown

I'm not able to open an issue, as that is currently restricted to contributors, of which I am not one. Hence, I'm just opening a PR with a fix, which I understand is not ideal.

We noticed a regression where empty initializers for aggregates are no longer accepted when emulating clang versions before clang 17. For example, the following fails with EDG 7.0:

  struct A {
    int i;
  };

  struct A a = {};

This seems to be due to the changes made as part of EDGcpfe/29042. This PR restores the behavior for empty aggregate initializers. Note that I picked clang 2.9 as the lower bound, as that was the minimum version I was reasonably able to test against.

@daveedvdv-nvidia

Copy link
Copy Markdown

Was Clang 2.9 really the first version which enabled this?
Otherwise, it might be clearer to just go with clangc_version_is(any_version)?

@jketema

jketema commented Oct 7, 2026

Copy link
Copy Markdown
Author

Note that I picked clang 2.9 as the lower bound, as that was the minimum version I was reasonably able to test against.

As a wrote "Note that I picked clang 2.9 as the lower bound, as that was the minimum version I was reasonably able to test against.", but let me do some further digging and get back to you.

@daveedvdv-nvidia

Copy link
Copy Markdown

Ah yes, sorry, I missed that.
Thanks for investigating... generally-speaking, I think it's acceptable to emulate for clangc_version_is(any_version) if it can be reproduced as far back as Clang 3.8.

Also, I've open issue #238 for this (to use [GH #238] as the Changes entry tag).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants