From: Jonathan Wakely Date: Sun, 27 Apr 2014 16:36:26 +0000 (+0100) Subject: re PR libstdc++/60497 (unique_ptr tries to complete its type T even though it... X-Git-Tag: releases/gcc-4.8.3~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c24bdd9128a6f9fa3bc7b678be6de8272e882a4;p=thirdparty%2Fgcc.git re PR libstdc++/60497 (unique_ptr tries to complete its type T even though it's not required to be a complete type) PR libstdc++/60497 * include/std/tuple (get): Qualify calls to prevent ADL. * testsuite/20_util/tuple/60497.cc: New. From-SVN: r209842 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0ea753f48ac1..77da71b8b9a7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2014-04-27 Jonathan Wakely + + PR libstdc++/60497 + * include/std/tuple (get): Qualify calls to prevent ADL. + * testsuite/20_util/tuple/60497.cc: New. + 2012-04-05 Dominique d'Humieres Jack Howarth diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index ee2b2e1d4c20..9ab30e514558 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -755,14 +755,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename tuple_element<__i, tuple<_Elements...>>::type >::type get(tuple<_Elements...>& __t) noexcept - { return __get_helper<__i>(__t); } + { return std::__get_helper<__i>(__t); } template constexpr typename __add_c_ref< typename tuple_element<__i, tuple<_Elements...>>::type >::type get(const tuple<_Elements...>& __t) noexcept - { return __get_helper<__i>(__t); } + { return std::__get_helper<__i>(__t); } template constexpr typename __add_r_ref< diff --git a/libstdc++-v3/testsuite/20_util/tuple/60497.cc b/libstdc++-v3/testsuite/20_util/tuple/60497.cc new file mode 100644 index 000000000000..700d3c867f70 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/60497.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2014 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// libstdc++/60497 + +#include + +struct A; +template struct B { T t; }; + +using element_type = B*; +using tuple_type = std::tuple; + +tuple_type t; +const tuple_type ct; + +auto a = std::get<0>(t); +auto b = std::get<0>(ct);