Preparation for landing the tests for llvm::makeVisitor, including
breaking out the a "Counted" base class and explicitly testing
the prvalue case as distinct from the rvalue case.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/unittests/ADT/STLExtrasTest.cpp | ||
---|---|---|
157 | Probably doesn't need to be virtual, if no one ever destroys it polymorphically? But I guess we have warnings enabled that make that problematic? Could we use composition instead, then? (Range contains a Counted, rather than derives from?) |
llvm/unittests/ADT/STLExtrasTest.cpp | ||
---|---|---|
157 | Good point, I think I just reflexively made it virtual. I would prefer to use inheritence as it cuts down on the boilerplate in the derived classes to just using Counted::Counted. It doesn't seem like we have any warnings enabled that complain here, so I just made the destructor non-virtual |
Probably doesn't need to be virtual, if no one ever destroys it polymorphically? But I guess we have warnings enabled that make that problematic?
Could we use composition instead, then? (Range contains a Counted, rather than derives from?)