[Lldb-commits] [PATCH] D121161: [lldb] Avoid global constructor in LLDBLog.cpp
Shafik Yaghmour via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 8 14:04:30 PST 2022
shafik added a comment.
In D121161#3368117 <https://reviews.llvm.org/D121161#3368117>, @JDevlieghere wrote:
> In D121161#3367806 <https://reviews.llvm.org/D121161#3367806>, @labath wrote:
>
>> The class has a constexpr constructor. I thought that would be enough to avoid runtime initialization. Is this being flagged by something?
>
> 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.
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121161/new/
https://reviews.llvm.org/D121161
More information about the lldb-commits
mailing list