This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR56480 aka DR374. Allow explicit specialization in enclosing namespace.
- From: Jason Merrill <jason at redhat dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Nov 2014 10:11:22 -0500
- Subject: Re: [PATCH] Fix PR56480 aka DR374. Allow explicit specialization in enclosing namespace.
- Authentication-results: sourceware.org; auth=none
- References: <20141108115721 dot GA7865 at x4>
On 11/08/2014 06:57 AM, Markus Trippelsdorf wrote:
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit73.C
@@ -7,9 +7,9 @@
// the template
namespace N {
- template <class T> class foo; // { dg-error "" } referenced below
+ template <class T> class foo; // { dg-error "" "" { target { ! c++11 } } } referenced below
}
using namespace N;
-template <> class foo<void>; // { dg-error "" } invalid specialization
+template <> class foo<void>; // { dg-error "" "" { target { ! c++11 } } } invalid specialization
This should still get an error in C++11 mode.
I think we also need to test this:
namespace A {
namespace B {
template <class T> void f();
}
using namespace B;
}
template<> void A::f<>(); // { dg-error "" }
I think your code won't catch this, because we need to know what the
explicit namespace was, not just whether there was one.
Can we handle this in check_explicit_specialization rather than all the
way down in register_specialization?
Jason