+2001-05-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (pushdecl): Adjust error string.
+ (xref_tag): Adjust friend class injection warning. Remove the
+ inherited name from the class shadowed scope.
+
2001-05-17 Mark Mitchell <mark@codesourcery.com>
* except.c (cp_protect_cleanup_actions): New function.
else if (t == wchar_decl_node)
{
if (pedantic && ! DECL_IN_SYSTEM_HEADER (x))
- cp_pedwarn ("redeclaration of wchar_t as `%T'", TREE_TYPE (x));
+ cp_pedwarn ("redeclaration of `wchar_t' as `%T'",
+ TREE_TYPE (x));
/* Throw away the redeclaration. */
return t;
if (t && globalize && TREE_CODE (t) == TYPENAME_TYPE)
{
static int explained;
-
- cp_warning ("`%s %T' declares a new type at namespace scope;\n\
-to refer to the inherited type, say `%s %T::%T'%s",
- tag_name (tag_code), name, tag_name (tag_code),
- constructor_name (current_class_type), TYPE_IDENTIFIER (t),
- (!explained ? "\n\
-(names from dependent base classes are not visible to unqualified name lookup)"
- : ""));
-
- explained = 1;
+ tree shadowed;
+
+ cp_warning ("`%s %T' declares a new type at namespace scope",
+ tag_name (tag_code), name);
+ if (!explained++)
+ cp_warning (" names from dependent base classes are not visible to unqualified name lookup - to refer to the inherited type, say `%s %T::%T'%s",
+ tag_name (tag_code),
+ constructor_name (current_class_type),
+ TYPE_IDENTIFIER (t));
+
+ /* We need to remove the class scope binding for the
+ TYPENAME_TYPE as otherwise poplevel_class gets confused. */
+ for (shadowed = b->class_shadowed;
+ shadowed;
+ shadowed = TREE_CHAIN (shadowed))
+ if (TREE_TYPE (shadowed) == TYPE_NAME (t))
+ {
+ TREE_PURPOSE (shadowed) = NULL_TREE;
+ break;
+ }
}
if (t && TREE_CODE (t) != code && TREE_CODE (t) != TEMPLATE_TYPE_PARM
+2001-05-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/inherit2.C: Remove XFAIL.
+ * g++.old-deja/g++.pt/crash67.C: New test.
+
2001-05-17 Jeffrey D. Oldham <oldham@codesourcery.com>
* g++.old-deja/g++.other/debug9.C: New test.
--- /dev/null
+// Build don't link:
+// Special g++ Options:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 May 2001 <nathan@codesourcery.com>
+
+// Bug 2526. We ICE'd after diagnosing dependant name confusion in
+// friendliness when not being pedantic.
+
+template<typename T>
+struct B
+{
+ typedef B<T> Mother;
+};
+
+template<typename T>
+struct D : B<T>
+{
+ friend class Mother; // WARNING - defines namespace class
+};