C++20 is more strict when erroring out due to incomplete types.
Thus the code required some restructoring so that it complies in C++20.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There is potentially a way to move less code by keeping all declarations at place and only moving bodies of definitions of constructors and destructors to the .cpp file.
Not sure what's preferable (less code moves vs more functions inline in the header), @kadircet do you have an opinion?
Having as few code in headers as possible is the general style guide in LLVM, so I'd rather err towards that and put definitions out-of-line as much as possible. Therefore if we can getaway by just moving definitions out-of-line, while keeping rest of the header ordering the same, let's go with that if it's feasible
Having as few code in headers as possible is the general style guide in LLVM, so I'd rather err towards that and put definitions out-of-line as much as possible. Therefore if we can getaway by just moving definitions out-of-line, while keeping rest of the header ordering the same, let's go with that if it's feasible
Thanks! I will check if I can get a version without reordering.
I have updated the code. It turned out that much less code has to be moved than I initially thought. :)
thanks, LGTM! (btw, i know it's too late already, but in theory clangd has a code action called move definition out-of-line, could help with such refactorings in the future, if you didn't know already)