From 07fbdd7bda1166ab2722dbeb4fd3c6b8558b324b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 24 Sep 2021 14:32:34 +0100 Subject: [PATCH] libstdc++: Skip container adaptor tests that fail concept checks As an extension, our container adaptors SFINAE away the default constructor if the adapted sequence container is not default constructible. When _GLIBCXX_CONCEPT_CHECKS is defined we enforce that the sequence is default constructible, so the tests for the extension fail. This disables the relevant parts of the tests. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1.cc: Do not check non-default constructible sequences when _GLIBCXX_CONCEPT_CHECKS is defined. * testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1_c++98.cc: Likewise. * testsuite/23_containers/queue/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/23_containers/queue/requirements/explicit_instantiation/1_c++98.cc: Likewise. * testsuite/23_containers/stack/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/23_containers/stack/requirements/explicit_instantiation/1_c++98.cc: Likewise. --- .../priority_queue/requirements/explicit_instantiation/1.cc | 11 +++++++---- .../requirements/explicit_instantiation/1_c++98.cc | 11 +++++++---- .../queue/requirements/explicit_instantiation/1.cc | 2 ++ .../queue/requirements/explicit_instantiation/1_c++98.cc | 2 ++ .../stack/requirements/explicit_instantiation/1.cc | 2 ++ .../stack/requirements/explicit_instantiation/1_c++98.cc | 2 ++ 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1.cc index d1e18f8..a425001 100644 --- a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1.cc @@ -24,12 +24,15 @@ template class std::priority_queue; -struct NonDefaultConstructible : std::vector { - NonDefaultConstructible(int) { } -}; struct Cmp : std::less { Cmp(int) { } }; +template class std::priority_queue, Cmp>; + +#ifndef _GLIBCXX_CONCEPT_CHECKS +struct NonDefaultConstructible : std::vector { + NonDefaultConstructible(int) { } +}; template class std::priority_queue; template class std::priority_queue; -template class std::priority_queue, Cmp>; +#endif diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1_c++98.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1_c++98.cc index def9259..28549f5 100644 --- a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1_c++98.cc +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/explicit_instantiation/1_c++98.cc @@ -24,12 +24,15 @@ template class std::priority_queue; -struct NonDefaultConstructible : std::vector { - NonDefaultConstructible(int) { } -}; struct Cmp : std::less { Cmp(int) { } }; +template class std::priority_queue, Cmp>; + +#ifndef _GLIBCXX_CONCEPT_CHECKS +struct NonDefaultConstructible : std::vector { + NonDefaultConstructible(int) { } +}; template class std::priority_queue; template class std::priority_queue; -template class std::priority_queue, Cmp>; +#endif diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1.cc index b737a15..3b9090c 100644 --- a/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1.cc @@ -24,7 +24,9 @@ template class std::queue; +#ifndef _GLIBCXX_CONCEPT_CHECKS struct NonDefaultConstructible : std::deque { NonDefaultConstructible(int) { } }; template class std::queue; +#endif diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1_c++98.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1_c++98.cc index 2e2d6a4..1cc4410 100644 --- a/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1_c++98.cc +++ b/libstdc++-v3/testsuite/23_containers/queue/requirements/explicit_instantiation/1_c++98.cc @@ -24,7 +24,9 @@ template class std::queue; +#ifndef _GLIBCXX_CONCEPT_CHECKS struct NonDefaultConstructible : std::deque { NonDefaultConstructible(int) { } }; template class std::queue; +#endif diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1.cc index 8002099..82e8e85 100644 --- a/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1.cc @@ -24,7 +24,9 @@ template class std::stack; +#ifndef _GLIBCXX_CONCEPT_CHECKS struct NonDefaultConstructible : std::deque { NonDefaultConstructible(int) { } }; template class std::stack; +#endif diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1_c++98.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1_c++98.cc index c66c597..8ff20fc 100644 --- a/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1_c++98.cc +++ b/libstdc++-v3/testsuite/23_containers/stack/requirements/explicit_instantiation/1_c++98.cc @@ -24,7 +24,9 @@ template class std::stack; +#ifndef _GLIBCXX_CONCEPT_CHECKS struct NonDefaultConstructible : std::deque { NonDefaultConstructible(int) { } }; template class std::stack; +#endif -- 2.7.4