From 01a665a876ab04aa212a3a80c9c1ce2e685bf5c4 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 23 Jan 2019 23:06:18 +0000 Subject: [PATCH] Apply D28248: 'Work around GCC PR37804'. Thanks to mdaniels for the patch git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351993 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__tree | 7 +++++++ .../associative/map/gcc_workaround.pass.cpp | 21 +++++++++++++++++++ .../associative/set/gcc_workaround.pass.cpp | 21 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 test/std/containers/associative/map/gcc_workaround.pass.cpp create mode 100644 test/std/containers/associative/set/gcc_workaround.pass.cpp diff --git a/include/__tree b/include/__tree index 4144a9599..9f0931ee9 100644 --- a/include/__tree +++ b/include/__tree @@ -26,6 +26,13 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD +#if defined(__GNUC__) && !defined(__clang__) // gcc.gnu.org/PR37804 +template class _LIBCPP_TEMPLATE_VIS map; +template class _LIBCPP_TEMPLATE_VIS multimap; +template class _LIBCPP_TEMPLATE_VIS set; +template class _LIBCPP_TEMPLATE_VIS multiset; +#endif + template class __tree; template class _LIBCPP_TEMPLATE_VIS __tree_iterator; diff --git a/test/std/containers/associative/map/gcc_workaround.pass.cpp b/test/std/containers/associative/map/gcc_workaround.pass.cpp new file mode 100644 index 000000000..622449fac --- /dev/null +++ b/test/std/containers/associative/map/gcc_workaround.pass.cpp @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Tests workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37804 + +#include +std::map::iterator it; +#include +using std::set; +using std::multiset; + +int main(void) +{ + return 0; +} diff --git a/test/std/containers/associative/set/gcc_workaround.pass.cpp b/test/std/containers/associative/set/gcc_workaround.pass.cpp new file mode 100644 index 000000000..2b923b773 --- /dev/null +++ b/test/std/containers/associative/set/gcc_workaround.pass.cpp @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Tests workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37804 + +#include +std::set s; +#include +using std::map; +using std::multimap; + +int main(void) +{ + return 0; +}