2007-08-24 Jakub Jelinek <jakub@redhat.com>
+ PR c++/32898
+ * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
+ is error_mark_node rather than NULL_TREE.
+ * pt.c (check_explicit_specialization): Likewise.
+
PR c++/31941
* error.c (resolve_virtual_fun_from_obj_type_ref): Handle
TARGET_VTABLE_USES_DESCRIPTORS targets properly.
/* See whether this has been declared in the namespace. */
old = lookup_qualified_name (scope, DECL_NAME (decl), false, true);
- if (!old)
+ if (old == error_mark_node)
/* No old declaration at all. */
goto complain;
if (!is_overloaded_fn (decl))
context. */
fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname,
false, true);
- if (!fns || !is_overloaded_fn (fns))
+ if (fns == error_mark_node || !is_overloaded_fn (fns))
{
error ("%qD is not a template function", dname);
fns = error_mark_node;
/* This specialization has the same linkage and visibility as
the function template it specializes. */
TREE_PUBLIC (decl) = TREE_PUBLIC (tmpl_func);
+ if (! TREE_PUBLIC (decl) && DECL_INTERFACE_KNOWN (tmpl_func))
+ DECL_INTERFACE_KNOWN (decl) = 1;
DECL_THIS_STATIC (decl) = DECL_THIS_STATIC (tmpl_func);
if (DECL_VISIBILITY_SPECIFIED (tmpl_func))
{
2007-08-24 Jakub Jelinek <jakub@redhat.com>
+ PR c++/32898
+ * g++.dg/lookup/ns3.C: New test.
+
* gfortran.dg/assumed_charlen_sharing.f90: New test.
PR c++/31941
--- /dev/null
+// PR c++/32898
+
+namespace N { }
+
+int N::i; // { dg-error "should have been declared inside" }