You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to my understanding of the C++ standard this code should be correct and the output should be "A::A, A::GetValue, Result", but with Clang19 on Windows the order of GetVaule and the constructor is swapped, which leads to the wrong result. The same code works correctly with Clang on Linux and MSVC on Windows.
Platform:
Windows 10 22H2
Clang installer from Github (LLVM-19.1.0-win64.exe)
Visual Studio build tools 2022 (17.9.6)
The text was updated successfully, but these errors were encountered:
mprettner-huawei
changed the title
[clang][c++17] const static inline variable initialization order
[clang][c++17] const static inline variables initialized in wrong order on Windows
Oct 3, 2024
The following code produces a non-intuitive output when running with Clang19 on Windows:
The following output is generated:
According to my understanding of the C++ standard this code should be correct and the output should be "A::A, A::GetValue, Result", but with Clang19 on Windows the order of GetVaule and the constructor is swapped, which leads to the wrong result. The same code works correctly with Clang on Linux and MSVC on Windows.
Platform:
The text was updated successfully, but these errors were encountered: