+1999-02-24 Mike Stump <mrs@wrs.com>
+
+ * typeck.c (convert_for_assignment): Allow boolean integral constant
+ expressions to convert to null pointer.
+
+1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (lookup_namespace_name): Resolve namespace aliases.
+
+ * class.c (push_nested_class): Allow namespaces.
+
+ * decl2.c (set_decl_namespace): Add friendp parameter.
+ * decl.c (grokfndecl): Pass it.
+ (grokvardecl): Likewise.
+ * cp-tree.h: Change declaration.
+
1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (tsubst): Allow an array of explicit size zero.
{
tree context;
- my_friendly_assert (!type || TREE_CODE (type) != NAMESPACE_DECL, 980711);
-
+ /* A namespace might be passed in error cases, like A::B:C. */
if (type == NULL_TREE || type == error_mark_node || ! IS_AGGR_TYPE (type)
+ || TREE_CODE (type) == NAMESPACE_DECL
|| TREE_CODE (type) == TEMPLATE_TYPE_PARM
|| TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM)
return;
extern tree reparse_decl_as_expr PROTO((tree, tree));
extern tree finish_decl_parsing PROTO((tree));
extern tree check_cp_case_value PROTO((tree));
-extern void set_decl_namespace PROTO((tree, tree));
+extern void set_decl_namespace PROTO((tree, tree, int));
extern tree current_decl_namespace PROTO((void));
extern void push_decl_namespace PROTO((tree));
extern void pop_decl_namespace PROTO((void));
return error_mark_node;
}
+ namespace = ORIGINAL_NAMESPACE (namespace);
+
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 373);
val = binding_init (&_b);
/* If this decl has namespace scope, set that up. */
if (in_namespace)
- set_decl_namespace (decl, in_namespace);
+ set_decl_namespace (decl, in_namespace, friendp);
else if (publicp && ! ctype)
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
decl = build_decl (VAR_DECL, declarator, complete_type (type));
if (context)
- set_decl_namespace (decl, context);
+ set_decl_namespace (decl, context, 0);
context = DECL_CONTEXT (decl);
if (declarator && context && current_lang_name != lang_name_c)
}
if (in_namespace)
- set_decl_namespace (decl, in_namespace);
+ set_decl_namespace (decl, in_namespace, 0);
if (RIDBIT_SETP (RID_EXTERN, specbits))
{
outside scope. */
void
-set_decl_namespace (decl, scope)
+set_decl_namespace (decl, scope, friendp)
tree decl;
tree scope;
+ int friendp;
{
tree old;
if (scope == std_node)
/* Get rid of namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
- if (!is_namespace_ancestor (current_namespace, scope))
+ /* It is ok for friends to be qualified in parallel space. */
+ if (!friendp && !is_namespace_ancestor (current_namespace, scope))
cp_error ("declaration of `%D' not in a namespace surrounding `%D'",
decl, scope);
DECL_CONTEXT (decl) = FROB_CONTEXT (scope);
}
return cp_convert (type, rhs);
}
- else if (codel == POINTER_TYPE && coder == INTEGER_TYPE)
+ else if (codel == POINTER_TYPE
+ && (coder == INTEGER_TYPE
+ || coder == BOOLEAN_TYPE))
{
/* An explicit constant 0 can convert to a pointer,
but not a 0 that results from casting or folding. */