Index: llvm/include/llvm/ADT/SmallVector.h =================================================================== --- llvm/include/llvm/ADT/SmallVector.h +++ llvm/include/llvm/ADT/SmallVector.h @@ -858,10 +858,7 @@ /// Note that this does not attempt to be exception safe. /// template -class SmallVector : public SmallVectorImpl { - /// Inline space for elements which aren't stored in the base class. - SmallVectorStorage Storage; - +class SmallVector : public SmallVectorImpl, SmallVectorStorage { public: SmallVector() : SmallVectorImpl(N) {} Index: llvm/lib/Support/SmallVector.cpp =================================================================== --- llvm/lib/Support/SmallVector.cpp +++ llvm/lib/Support/SmallVector.cpp @@ -14,6 +14,10 @@ #include "llvm/ADT/SmallVector.h" using namespace llvm; +// Check that no bytes are wasted. +static_assert(sizeof(SmallVector) == sizeof(void *) * 4, + "wasted space in SmallVector size 1; missing EBO?"); + /// grow_pod - This is an implementation of the grow() method which only works /// on POD-like datatypes and is out of line to reduce code duplication. void SmallVectorBase::grow_pod(void *FirstEl, size_t MinSizeInBytes,