Issue 74070
Summary "Improve heuristic to determine whether to evaluate a static variable's initializer" broke compiling Qt Declarative
Labels clang, clang:codegen, regression, clang:diagnostics
Assignees
Reporter mstorsjo
    The commit 53a24c33f09b81b8f009afbabd05f7086db3f288, 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](https://github.com/llvm/llvm-project/files/13526389/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 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to