]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/60497 (unique_ptr<T> tries to complete its type T even though it...
authorJonathan Wakely <jwakely@redhat.com>
Sun, 27 Apr 2014 16:36:26 +0000 (17:36 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 27 Apr 2014 16:36:26 +0000 (17:36 +0100)
PR libstdc++/60497
* include/std/tuple (get): Qualify calls to prevent ADL.
* testsuite/20_util/tuple/60497.cc: New.

From-SVN: r209842

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/60497.cc [new file with mode: 0644]

index 0ea753f48ac1bc6eabda612f7469d04edc85eec6..77da71b8b9a71c66bd7c6ed25e1724d38e7c6d03 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-27  Jonathan Wakely  <jwakely@redhat.com>
+
+       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  <dominiq@lps.ens.fr>
            Jack Howarth <howarth@bromo.med.uc.edu>
 
index ee2b2e1d4c20dc625cc77e776dd69fa4685bf54b..9ab30e5145587d68a84152028045c22c303e22c1 100644 (file)
@@ -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<std::size_t __i, typename... _Elements>
     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<std::size_t __i, typename... _Elements>
     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 (file)
index 0000000..700d3c8
--- /dev/null
@@ -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
+// <http://www.gnu.org/licenses/>.
+
+// libstdc++/60497
+
+#include <tuple>
+
+struct A;
+template<typename T> struct B { T t; };
+
+using element_type = B<A>*;
+using tuple_type = std::tuple<element_type>;
+
+tuple_type t;
+const tuple_type ct;
+
+auto a = std::get<0>(t);
+auto b = std::get<0>(ct);