Skip to content

[clang][bytecode] new interpreter fails with case ranges inside constexpr function #165969

@k-arrows

Description

@k-arrows

Reproducer:
https://godbolt.org/z/KorssdanW

constexpr int foo(int i) {
  switch (i) {
  case 11 ... 12:
    return 4;
  case 0 ... 9:
    return 3;
  default:
    return 7;
  }
}

static_assert(foo(-1) == 7, "");

When the above program is compiled with option -fexperimental-new-constant-interpreter enabled, it fails. When the option is disabled, it succeeds as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:bytecodeIssues for the clang bytecode constexpr interpreterenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions