aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2014-04-15 20:05:45 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2014-04-15 20:05:45 +0100
commit3a0f3672e53baa9accab7427bb47eaa8a7a2f151 (patch)
tree5889e2a93598938cf0aac4d40ff9ebf40bef8cc1
parent227df36e33d877a31ac1beb8755214ede47e6f76 (diff)
downloadgcc-3a0f3672e53baa9accab7427bb47eaa8a7a2f151.zip
gcc-3a0f3672e53baa9accab7427bb47eaa8a7a2f151.tar.gz
gcc-3a0f3672e53baa9accab7427bb47eaa8a7a2f151.tar.bz2
re PR c++/60786 (In C++11 an explicit instantiation with an unqualified name must be in the right namespace)
PR c++/60786 * testsuite/20_util/shared_ptr/requirements/explicit_instantiation/ 1.cc: Fix invalid explicit instantiations with unqualified names. * testsuite/20_util/shared_ptr/requirements/explicit_instantiation/ 2.cc: Likweise. * testsuite/20_util/tuple/53648.cc: Likweise. * testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/23_containers/unordered_map/requirements/ debug_container.cc: Likewise. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation/3.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/debug.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/3.cc: Likewise. * testsuite/23_containers/unordered_multiset/requirements/debug.cc: Likewise. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation/3.cc: Likewise. * testsuite/23_containers/unordered_set/requirements/ debug_container.cc: Likewise. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation/3.cc: Likewise. From-SVN: r209431
-rw-r--r--libstdc++-v3/ChangeLog27
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc11
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/2.cc9
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/53648.cc10
-rw-r--r--libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc11
-rw-r--r--libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc11
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc18
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/debug.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/debug.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/requirements/debug_container.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc5
14 files changed, 77 insertions, 58 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a9545ff..a2b7396 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -22,6 +22,33 @@
* include/std/atomic: Uglify parameter names.
+ PR c++/60786
+ * testsuite/20_util/shared_ptr/requirements/explicit_instantiation/
+ 1.cc: Fix invalid explicit instantiations with unqualified names.
+ * testsuite/20_util/shared_ptr/requirements/explicit_instantiation/
+ 2.cc: Likweise.
+ * testsuite/20_util/tuple/53648.cc: Likweise.
+ * testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc:
+ Likewise.
+ * testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_map/requirements/
+ debug_container.cc: Likewise.
+ * testsuite/23_containers/unordered_map/requirements/
+ explicit_instantiation/3.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/requirements/debug.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multimap/requirements/
+ explicit_instantiation/3.cc: Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/debug.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/
+ explicit_instantiation/3.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/
+ debug_container.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/
+ explicit_instantiation/3.cc: Likewise.
+
2014-04-14 Jonathan Wakely <jwakely@redhat.com>
* include/bits/stl_vector.h (_Vector_base::_Vector_impl,
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc
index 40ebec0..0d81481 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/1.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
@@ -24,8 +24,7 @@
#include <testsuite_tr1.h>
using namespace __gnu_test;
-using std::shared_ptr;
-template class shared_ptr<int>;
-template class shared_ptr<void>;
-template class shared_ptr<ClassType>;
-template class shared_ptr<IncompleteClass>;
+template class std::shared_ptr<int>;
+template class std::shared_ptr<void>;
+template class std::shared_ptr<ClassType>;
+template class std::shared_ptr<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/2.cc
index 148375a..37a0c1d1 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/explicit_instantiation/2.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -27,8 +27,7 @@
// library this checks the templates can be instantiated for non-default
// lock policy, for a single-threaded lib this is redundant but harmless.
using namespace __gnu_test;
-using std::__shared_ptr;
using std::_S_single;
-template class __shared_ptr<int, _S_single>;
-template class __shared_ptr<ClassType, _S_single>;
-template class __shared_ptr<IncompleteClass, _S_single>;
+template class std::__shared_ptr<int, _S_single>;
+template class std::__shared_ptr<ClassType, _S_single>;
+template class std::__shared_ptr<IncompleteClass, _S_single>;
diff --git a/libstdc++-v3/testsuite/20_util/tuple/53648.cc b/libstdc++-v3/testsuite/20_util/tuple/53648.cc
index 7bde67e..fb37638 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/53648.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/53648.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2012-2014 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ using std::tuple;
struct A { };
-template class tuple<tuple<>>;
-template class tuple<tuple<tuple<>>>;
-template class tuple<A, tuple<A, tuple<A, tuple<A>>>>;
-template class tuple<tuple<tuple<A, A>, A>, A>;
+template class std::tuple<tuple<>>;
+template class std::tuple<tuple<tuple<>>>;
+template class std::tuple<A, tuple<A, tuple<A, tuple<A>>>>;
+template class std::tuple<tuple<tuple<A, A>, A>, A>;
// Verify the following QoI properties are preserved
diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc
index c5a30f2..0a15e46 100644
--- a/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/1.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2006-2014 Free Software Foundation, Inc.
@@ -24,8 +24,7 @@
#include <testsuite_tr1.h>
using namespace __gnu_test;
-using std::weak_ptr;
-template class weak_ptr<int>;
-template class weak_ptr<void>;
-template class weak_ptr<ClassType>;
-template class weak_ptr<IncompleteClass>;
+template class std::weak_ptr<int>;
+template class std::weak_ptr<void>;
+template class std::weak_ptr<ClassType>;
+template class std::weak_ptr<IncompleteClass>;
diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc
index 5c1e91b..c0873a1 100644
--- a/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/20_util/weak_ptr/requirements/explicit_instantiation/2.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -27,9 +27,8 @@
// library this checks the templates can be instantiated for non-default
// lock policy, for a single-threaded lib this is redundant but harmless.
using namespace __gnu_test;
-using std::__weak_ptr;
using std::_S_single;
-template class __weak_ptr<int, _S_single>;
-template class __weak_ptr<void, _S_single>;
-template class __weak_ptr<ClassType, _S_single>;
-template class __weak_ptr<IncompleteClass, _S_single>;
+template class std::__weak_ptr<int, _S_single>;
+template class std::__weak_ptr<void, _S_single>;
+template class std::__weak_ptr<ClassType, _S_single>;
+template class std::__weak_ptr<IncompleteClass, _S_single>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc
index abd9d2c..c4d3442 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,18 +21,16 @@
#include <string>
#include <debug/unordered_map>
-using namespace __gnu_debug;
-
using std::allocator;
using std::equal_to;
using std::hash;
using std::pair;
using std::string;
-template class unordered_map<string, float>;
-template class unordered_map<string, int,
- hash<string>, equal_to<string>,
- allocator<pair<const string, int> > >;
-template class unordered_map<string, float,
- hash<string>, equal_to<string>,
- allocator<char> >;
+template class __gnu_debug::unordered_map<string, float>;
+template class __gnu_debug::unordered_map<string, int,
+ hash<string>, equal_to<string>,
+ allocator<pair<const string, int>>>;
+template class __gnu_debug::unordered_map<string, float,
+ hash<string>, equal_to<string>,
+ allocator<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
index de46c5c..145d23e 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,4 +21,5 @@
#include <unordered_map>
using namespace std;
-template class unordered_map<int, int, hash<int>, equal_to<int>, allocator<char>>;
+template class std::unordered_map<int, int, hash<int>, equal_to<int>,
+ allocator<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/debug.cc
index 488dbe5..d2d7076 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/debug.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/debug.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,8 +21,6 @@
#include <string>
#include <debug/unordered_map>
-using namespace __gnu_debug;
-
using std::string;
-template class unordered_multimap<string, float>;
+template class __gnu_debug::unordered_multimap<string, float>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
index e3d0f47..8640bc3 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,4 +21,5 @@
#include <unordered_map>
using namespace std;
-template class unordered_multimap<int, int, hash<int>, equal_to<int>, allocator<char>>;
+template class std::unordered_multimap<int, int, hash<int>, equal_to<int>,
+ allocator<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/debug.cc
index bc35441..5e916ad 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/debug.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/debug.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,6 +21,4 @@
#include <string>
#include <debug/unordered_set>
-using namespace __gnu_debug;
-
-template class unordered_multiset<int>;
+template class __gnu_debug::unordered_multiset<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
index 2a81347..c4624b5 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,4 +21,5 @@
#include <unordered_set>
using namespace std;
-template class unordered_multiset<int, hash<int>, equal_to<int>, allocator<char>>;
+template class std::unordered_multiset<int, hash<int>, equal_to<int>,
+ allocator<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/debug_container.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/debug_container.cc
index 948c662..f6ab585 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/debug_container.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/debug_container.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -20,6 +20,4 @@
#include <debug/unordered_set>
-using namespace __gnu_debug;
-
-template class unordered_set<int>;
+template class __gnu_debug::unordered_set<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
index 5cdcb3e..27be027 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-options "-std=gnu++11" }
// { dg-do compile }
// Copyright (C) 2007-2014 Free Software Foundation, Inc.
@@ -21,4 +21,5 @@
#include <unordered_set>
using namespace std;
-template class unordered_set<int, hash<int>, equal_to<int>, allocator<char>>;
+template class std::unordered_set<int, hash<int>, equal_to<int>,
+ allocator<char>>;