]> git.ipfire.org Git - thirdparty/gcc.git/commit
Enforce LWG DR 2566 requirement for container adaptors
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Feb 2019 14:10:12 +0000 (14:10 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Feb 2019 14:10:12 +0000 (14:10 +0000)
commitee32dd6496e6a73084aac37a5d9f488b13188dbe
tree1224e15bd9662936e0ecc5037eacc49dc8414fb8
parentdac1fbf62c5293c4b6b2788a6d9677c73088df5d
Enforce LWG DR 2566 requirement for container adaptors

Although there is no good use for stack<int, deque<double>> or similar
types with a mismatched value_type, it's possible somebody is doing that
and getting away with it currently. This patch only enforces the new
requirement for C++17 and later. During stage 1 we should consider
enforcing it for C++11 and C++14.

* doc/xml/manual/intro.xml: Document LWG 2566 status.
* include/bits/stl_queue.h (queue, priority_queue): Add static
assertions to enforce LWG 2566 requirement on value_type.
* include/bits/stl_stack.h (stack): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268877 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/doc/xml/manual/intro.xml
libstdc++-v3/include/bits/stl_queue.h
libstdc++-v3/include/bits/stl_stack.h