Skip to content

[clang][bytecode] compilation hangs when possible infinite loop exists #165951

@k-arrows

Description

@k-arrows

Reproducer:
https://godbolt.org/z/9WfeabYTx

constexpr int foo(int p) {
  int t = 0;
  while (1)
    ;
  return t;
}

static_assert (foo (1) == 0, "");

When the above program is compiled with option -fexperimental-new-constant-interpreter enabled, it hangs. When the option is disabled, a compilation error is correctly reported as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:bytecodeIssues for the clang bytecode constexpr interpreterconfirmedVerified by a second partyhangCompiler hang (infinite loop)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions