Protect the ArgList dtor

It could even be made non-virtual if it weren't for bad compiler
warnings.

This demonstrates that ArgList objects aren't destroyed polymorphically
and possibly that they aren't even used polymorphically. If that's the
case, it might be possible to refactor the two ArgList types more
separately and simplify the Arg ownership model. *continues
experimenting*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206727 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-04-20 23:59:00 +00:00
parent f4a2635c25
commit 1df9ce8da5
2 changed files with 6 additions and 7 deletions

View File

@ -106,10 +106,14 @@ private:
arglist_type Args; arglist_type Args;
protected: protected:
ArgList(); // Default ctor provided explicitly as it is not provided implicitly due to
// the presence of the (deleted) copy ctor above.
ArgList() { }
// Virtual to provide a vtable anchor and because -Wnon-virtua-dtor warns, not
// because this type is ever actually destroyed polymorphically.
virtual ~ArgList();
public: public:
virtual ~ArgList();
/// @name Arg Access /// @name Arg Access
/// @{ /// @{

View File

@ -33,11 +33,6 @@ void arg_iterator::SkipToNextArg() {
} }
} }
//
ArgList::ArgList() {
}
ArgList::~ArgList() { ArgList::~ArgList() {
} }