Skip to content

<deque>: deque should support incomplete value types #108

Description

Describe the bug
Due to these two lines, deque cannot be used without the definition of the element type:

enum { _EEN_DS = _DEQUESIZ }; // helper for expression evaluator

enum { _EEN_DS = _DEQUESIZ }; // helper for expression evaluator

Seems unnecessary, since the enumerator doesn't seem to be referenced anywhere in the codebase.

Command-line test case
STL version (git commit or Visual Studio version):
ee1ede2

#include <deque>

class foo
{
    foo();
    foo(const foo&) = delete;
    foo(foo&&) = delete;
    foo& operator=(const foo&) = delete;
    foo& operator=(foo&&) = delete;

    ~foo();

    struct impl;
    std::deque<impl> m_impl;
};

c:\Users\Davide\Desktop>cl repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.21.27702.2 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

repro.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include\deque(606): error C2027: use of undefined type 'foo::impl'
repro.cpp(13): note: see declaration of 'foo::impl'
repro.cpp(14): note: see reference to class template instantiation 'std::deque<foo::impl,std::allocator<_Ty>>' being compiled
        with
        [
            _Ty=foo::impl
        ]

Expected behavior
I would expect it to be pimpl-friendly just like other stl implementations: https://godbolt.org/z/JNqc_R

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions