Given an incomplete type:
struct S;
Then the following declarations are:
S *p; // ok, pointer to incomplete types is allowed
std::deque<S> l; // error, instantiating std::deque with incomplete type is UB
But what about the following declarations?
std::deque<S> *p; // seems to be UB like the previous case,
// but is it ok if p is not used till S is defined?
std::deque<S*> p; // not really sure about this one
Edit: the question used std::list instead of std::deque, but that defeats the purpose of the question, since std::list is explicitly allowed to use incomplete types. std::deque doesn't appear to have such permission.