This is an archive of the discontinued LLVM Phabricator instance.

Get rid of global constructor in llvm/lib/Support/Signals.cpp in C++20 mode
ClosedPublic

Authored by Godin on Jan 13 2022, 1:36 PM.

Details

Summary

Without this patch when using CMAKE_CXX_STANDARD=20 and Clang 13
build fails with

llvm/lib/Support/Signals.cpp:86:26: error: declaration requires a global constructor [-Werror,-Wglobal-constructors]

Diff Detail

Event Timeline

Godin created this revision.Jan 13 2022, 1:36 PM
Godin requested review of this revision.Jan 13 2022, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 1:36 PM
mehdi_amini accepted this revision.Jan 25 2022, 3:19 PM

LGTM, but do you know what explains this behavior in C++20?

llvm/lib/Support/Signals.cpp
86

Do you

This revision is now accepted and ready to land.Jan 25 2022, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2022, 4:02 PM