From 28166dd9b385861fb5bbadd7186cca16fc6a5174 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 llvm-svn: 351993 --- libcxx/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 libcxx/test/std/containers/associative/map/gcc_workaround.pass.cpp create mode 100644 libcxx/test/std/containers/associative/set/gcc_workaround.pass.cpp diff --git a/libcxx/include/__tree b/libcxx/include/__tree index 4144a9599925..9f0931ee9407 100644 --- a/libcxx/include/__tree +++ b/libcxx/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/libcxx/test/std/containers/associative/map/gcc_workaround.pass.cpp b/libcxx/test/std/containers/associative/map/gcc_workaround.pass.cpp new file mode 100644 index 000000000000..622449facc11 --- /dev/null +++ b/libcxx/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/libcxx/test/std/containers/associative/set/gcc_workaround.pass.cpp b/libcxx/test/std/containers/associative/set/gcc_workaround.pass.cpp new file mode 100644 index 000000000000..2b923b773403 --- /dev/null +++ b/libcxx/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; +}