Skip to content

"Improve heuristic to determine whether to evaluate a static variable's initializer" broke compiling Qt Declarative #74070

Open
@mstorsjo

Description

@mstorsjo

The commit 53a24c3, broke compiling of Qt Declarative (observed with version 5.15), where compilation now fails with this error:

In file included from jit/qv4baselineassembler.cpp:45:
jit/qv4assemblercommon_p.h:253:42: error: integer value -1 is outside the valid range of values [0, 7] for the enumeration type 'RegisterID' [-Wenum-constexpr-conversion]
  253 |     static const RegisterID NoRegister = RegisterID(-1);
      |                                          ^

The surprising thing is that this error only pops up when compiling with debug info enabled - without debug info, it still compiles fine.

The issue can be reproduced with this attached file, enum-range-preproc.zip, compiled with clang -target i686-w64-mingw32 -c -g enum-range-preproc.cpp. Without the -g parameter, it successfully compiles.

CC @Michael137 @shafik @AaronBallman

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions