Protected member is “not declared in this scope” in derived class [duplicate] September 20, 2023 by Tarik To fix this, you need to specify Base<T>::data_.clear() or this->data_.clear(). As for why this happens, see here.