PR c++/42062
* pt.c (check_specialization_namespace): Complain about
specialization at non-namespace scope.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155349
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-12-18 Jason Merrill <jason@redhat.com>
+ PR c++/28300
+ PR c++/42062
+ * pt.c (check_specialization_namespace): Complain about
+ specialization at non-namespace scope.
+
PR c++/42415
* call.c (build_new_method_call): Complain about calling the
constructor directly.
function, member class or static data member of a class template
shall be declared in the namespace of which the class template is
a member. */
+ if (current_scope() != DECL_CONTEXT (tmpl)
+ && !at_namespace_scope_p ())
+ {
+ error ("specialization of %qD must appear at namespace scope", tmpl);
+ return false;
+ }
if (is_associated_namespace (current_namespace, tpl_ns))
/* Same or super-using namespace. */
return true;
2009-12-18 Jason Merrill <jason@redhat.com>
+ PR c++/28300
+ * g++.dg/template/spec37.C: New.
+
PR c++/42415
* g++.dg/tc1/dr147.C: Add test.
--- /dev/null
+// PR c++/28300
+
+template<typename> struct A
+{
+ template<typename T> struct A<T*>; // { dg-error "namespace scope" }
+};