Skip to content

CWG2536 Zero-initialization in addition to constant initialization and stability of padding bits #1380

Open
@jensmaurer

Description

@jensmaurer

See CWG2558 and CWG2536

CWG2558: Is it intentional that uninitialized subobjects can appear in prvalues returned by constant expressions?
P1331R2 dropped the corresponding restriction, but maybe that wasn't entirely intentional.

  struct A {
    int n;
    consteval A() {}
  };
  constexpr A a;

CWG2536: The variable a is a variable with static storage duration, which previously could not have subobjects with indeterminate value (because of zero-initialization). The status quo wording does permit such indeterminate values. Is that intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EWGEvolutionneeds-revisionPaper needs changes before it can proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions