Avoid a static initializer for Log::Channel in LLDBLog.cpp
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
The class has a constexpr constructor. I thought that would be enough to avoid runtime initialization. Is this being flagged by something?
Comment Actions
It is getting flagged by -Wglobal-constructor but you're right, it's constexpr and therefore shouldn't. Might be a bug in clang. I'll try to repro with ToT.
Comment Actions
I wonder if for ArrayRef the copy constructor does not look constexpr and so if you change it to constexpr static if it will be ill-formed, that would mean it is not really constant initialization and therefore that would make it dynamic since it also not static initialization since you are calling a constructor.
Comment Actions
Amusingly enough, the problem is the custom operator| used for bitmask enums. D121281 ought to fix that (by making the function constexpr).