PR c++/28505
* decl.c (grokdeclarator): Return early after
issuing diagnostic about an incomplete type.
+
+ PR c++/28741
+ * tree.c (decl_anon_ns_mem_p): Robustify.
+ * decl2.c (determine_visibility): Likewise.
2006-08-20 Mark Mitchell <mark@codesourcery.com>
? TYPE_TEMPLATE_INFO (TREE_TYPE (decl))
: DECL_TEMPLATE_INFO (decl));
tree args = TI_ARGS (tinfo);
- int depth = TMPL_ARGS_DEPTH (args);
- tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo));
-
- if (!DECL_VISIBILITY_SPECIFIED (decl))
+
+ if (args != error_mark_node)
{
- DECL_VISIBILITY (decl) = DECL_VISIBILITY (pattern);
- DECL_VISIBILITY_SPECIFIED (decl)
- = DECL_VISIBILITY_SPECIFIED (pattern);
- }
+ int depth = TMPL_ARGS_DEPTH (args);
+ tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo));
+
+ if (!DECL_VISIBILITY_SPECIFIED (decl))
+ {
+ DECL_VISIBILITY (decl) = DECL_VISIBILITY (pattern);
+ DECL_VISIBILITY_SPECIFIED (decl)
+ = DECL_VISIBILITY_SPECIFIED (pattern);
+ }
- /* FIXME should TMPL_ARGS_DEPTH really return 1 for null input? */
- if (args && depth > template_class_depth (class_type))
- /* Limit visibility based on its template arguments. */
- constrain_visibility_for_template (decl, args);
+ /* FIXME should TMPL_ARGS_DEPTH really return 1 for null input? */
+ if (args && depth > template_class_depth (class_type))
+ /* Limit visibility based on its template arguments. */
+ constrain_visibility_for_template (decl, args);
+ }
}
if (class_type)