+Wed Sep 18 04:24:07 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * method.c (make_thunk): Call comdat_linkage before setting the
+ TREE_CODE.
+
+ * decl2.c (comdat_linkage): Use make_decl_one_only.
+ (import_export_decl): Likewise.
+ * decl.c (init_decl_processing): Check supports_one_only instead of
+ SUPPORTS_WEAK.
+
+Sat Sep 14 08:34:41 1996 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (grokfield): Tighten checking for access decls.
+
+ * decl.c (make_typename_type): Resolve references to
+ current_class_type. Set CLASSTYPE_GOT_SEMICOLON.
+ (lookup_name_real): Types that depend on a template parameter get
+ an implicit 'typename' unless they're in the current scope.
+ (start_decl_1): We don't care about incomplete types that depend
+ on a template parm.
+ (grokdeclarator): Resolve 'typename's in the type specifier that
+ refer to members of the current scope.
+
+ * call.c (build_over_call): Remove 'inline called before
+ definition' diagnostic.
+ (build_method_call): Likewise.
+ * decl.c (duplicate_decls): Downgrade 'used before declared
+ inline' to a warning, only with -Winline.
+
+Fri Sep 13 17:31:40 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Fix include paths, add @DASH_C_FLAG@ to compile.
+
Wed Sep 11 22:38:13 1996 Gerald Baumgartner <gb@cs.purdue.edu>
* call.c (build_method_call): When calling a signature
function = DECL_MAIN_VARIANT (function);
mark_used (function);
- if (pedantic && DECL_THIS_INLINE (function) && ! DECL_ARTIFICIAL (function)
- && ! DECL_INITIAL (function) && ! DECL_PENDING_INLINE_INFO (function)
- && ! (DECL_TEMPLATE_INFO (function)
- && TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (function))))
- cp_warning ("inline function `%#D' called before definition", function);
-
fntype = TREE_TYPE (function);
if (TREE_CODE (fntype) == POINTER_TYPE)
fntype = TREE_TYPE (fntype);
mark_used (fn);
- if (pedantic && DECL_THIS_INLINE (fn) && ! DECL_ARTIFICIAL (fn)
- && ! DECL_INITIAL (fn) && ! DECL_PENDING_INLINE_INFO (fn)
- && ! (DECL_TEMPLATE_INFO (fn)
- && TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (fn))))
- cp_warning ("inline function `%#D' called before definition", fn);
-
if (DECL_CONTEXT (fn) && IS_SIGNATURE (DECL_CONTEXT (fn)))
return build_signature_method_call (fn, converted_args);
else if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
}
}
- if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl))
+ if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl)
+ && TREE_ADDRESSABLE (olddecl) && warn_inline)
{
-#if 0 /* I think this will be correct, but it's really annoying. We should
- fix the compiler to find vtables by indirection so it isn't
- necessary. (jason 8/25/95) */
- if (DECL_VINDEX (olddecl) && ! DECL_ABSTRACT_VIRTUAL_P (olddecl))
- {
- cp_pedwarn ("virtual function `%#D' redeclared inline",
- newdecl);
- cp_pedwarn_at ("previous non-inline declaration here",
- olddecl);
- }
- else
-#endif
- if (TREE_ADDRESSABLE (olddecl))
- {
- cp_pedwarn ("`%#D' was used before it was declared inline",
- newdecl);
- cp_pedwarn_at ("previous non-inline declaration here",
- olddecl);
- }
+ cp_warning ("`%#D' was used before it was declared inline",
+ newdecl);
+ cp_warning_at ("previous non-inline declaration here",
+ olddecl);
}
}
/* These bits are logically part of the type for non-functions. */
/* Merge the storage class information. */
DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
-#ifdef DECL_ONE_ONLY
DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl);
-#endif
TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl);
if (! DECL_EXTERNAL (olddecl))
my_friendly_abort (2000);
if (! current_template_parms
- || ! uses_template_parms (context))
+ || ! uses_template_parms (context)
+ || context == current_class_type)
{
t = lookup_field (context, name, 0, 1);
if (t == NULL_TREE)
TYPE_CONTEXT (t) = context;
TYPE_MAIN_DECL (TREE_TYPE (d)) = d;
DECL_CONTEXT (d) = context;
+ CLASSTYPE_GOT_SEMICOLON (t) = 1;
return t;
}
else
val = NULL_TREE;
-#if 0
+#if 1
if (got_scope && current_template_parms
+ && got_scope != current_class_type
&& uses_template_parms (got_scope)
&& val && TREE_CODE (val) == TYPE_DECL
&& ! DECL_ARTIFICIAL (val))
flag_inline_functions = 0;
}
- if (! SUPPORTS_WEAK)
+ if (! supports_one_only ())
flag_weak = 0;
/* Create the global bindings for __FUNCTION__ and __PRETTY_FUNCTION__. */
&& TREE_CODE (decl) != TEMPLATE_DECL
&& IS_AGGR_TYPE (type) && ! DECL_EXTERNAL (decl))
{
- if (TYPE_SIZE (complete_type (type)) == NULL_TREE)
+ if ((! current_template_parms || ! uses_template_parms (type))
+ && TYPE_SIZE (complete_type (type)) == NULL_TREE)
{
cp_error ("aggregate `%#D' has incomplete type and cannot be initialized",
decl);
else
{
type = TREE_TYPE (id);
+ if (TREE_CODE (type) == TYPENAME_TYPE
+ && TYPE_CONTEXT (type) == current_class_type)
+ {
+ /* Members of the current class get resolved immediately;
+ we couldn't catch this one earlier because we hadn't
+ pushed into the class yet. */
+ if (TREE_TYPE (type))
+ type = TREE_TYPE (type);
+ else
+ type = make_typename_type (TYPE_CONTEXT (type),
+ TYPE_IDENTIFIER (type));
+ }
TREE_VALUE (spec) = type;
}
goto found;
}
ctype = TREE_OPERAND (declarator, 0);
+ if (TREE_CODE (ctype) == TYPENAME_TYPE
+ && TYPE_CONTEXT (ctype) == current_class_type)
+ {
+ /* Members of the current class get resolved immediately;
+ we couldn't catch this one earlier because we hadn't
+ pushed into the class yet. */
+ if (TREE_TYPE (ctype))
+ ctype = TREE_TYPE (ctype);
+ else
+ ctype = make_typename_type (TYPE_CONTEXT (ctype),
+ TYPE_IDENTIFIER (ctype));
+ }
+
if (sname == NULL_TREE)
goto done_scoping;
}
if (declspecs == NULL_TREE
- && TREE_CODE (declarator) == SCOPE_REF)
+ && TREE_CODE (declarator) == SCOPE_REF
+ && TREE_CODE (TREE_OPERAND (declarator, 1)) == IDENTIFIER_NODE)
{
/* Access declaration */
if (! IS_AGGR_TYPE_CODE (TREE_CODE (TREE_OPERAND (declarator, 0))))
comdat_linkage (decl)
tree decl;
{
- TREE_PUBLIC (decl) = 0;
-
-#ifdef MAKE_DECL_ONE_ONLY
- MAKE_DECL_ONE_ONLY (decl);
- TREE_PUBLIC (decl) = 1;
-#endif
-
if (flag_weak)
- {
- DECL_WEAK (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- }
+ make_decl_one_only (decl);
+ else
+ TREE_PUBLIC (decl) = 0;
}
/* Set TREE_PUBLIC and/or DECL_EXTERN on the vtable DECL,
{
if (write_virtuals >= 0
&& ! DECL_EXTERNAL (vars)
- && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars)
-#ifdef DECL_ONE_ONLY
- && ! DECL_ONE_ONLY (vars)
-#endif
- )
+ && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars))
|| (hack_decl_function_context (vars) && TREE_USED (vars)))
&& ! TREE_ASM_WRITTEN (vars))
{
/* Statically initialized vars are weak or comdat, if
supported. */
-#ifdef MAKE_DECL_ONE_ONLY
- MAKE_DECL_ONE_ONLY (decl);
-#endif
if (flag_weak)
- DECL_WEAK (decl) = 1;
+ make_decl_one_only (decl);
/* else leave vars public so multiple defs will break. */
}
}
&& ! DECL_EXTERNAL (decl))
{
int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
-#ifdef DECL_ONE_ONLY
|| DECL_ONE_ONLY (decl)
-#endif
|| DECL_WEAK (decl)));
temp = build_cleanup (decl);
if (TREE_CODE (decl) == VAR_DECL)
{
int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
-#ifdef DECL_ONE_ONLY
|| DECL_ONE_ONLY (decl)
-#endif
|| DECL_WEAK (decl)));
/* Set these global variables so that GDB at least puts
else if (DECL_INITIAL (decl) == 0)
p = &TREE_CHAIN (*p);
else if ((TREE_PUBLIC (decl) && ! DECL_WEAK (decl)
-#ifdef DECL_ONE_ONLY
- && ! DECL_ONE_ONLY (decl)
-#endif
- )
+ && ! DECL_ONE_ONLY (decl))
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
|| flag_keep_inline_functions)
{
TREE_READONLY (thunk) = TYPE_READONLY (TREE_TYPE (vtable_entry_type));
TREE_THIS_VOLATILE (thunk) = TYPE_VOLATILE (TREE_TYPE (vtable_entry_type));
make_function_rtl (thunk);
+ comdat_linkage (thunk);
TREE_SET_CODE (thunk, THUNK_DECL);
DECL_INITIAL (thunk) = function;
THUNK_DELTA (thunk) = delta;
DECL_EXTERNAL (thunk) = 1;
- comdat_linkage (thunk);
/* So that finish_file can write out any thunks that need to be: */
pushdecl_top_level (thunk);
}
/^SUBDIR_MALLOC/s/`.*`//
# Point includes at parent directly correctly.
-/^INCLUDES = .*$/s/:\./::/g
-/^INCLUDES = .*$/s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g
+/^INCLUDES = /s/:\./::/g
+/^INCLUDES = /s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g
+/^INCLUDES = /s,"{srcdir}"/\.\.,"{topsrcdir}"gcc:,g
+/^INCLUDES = /s,"{srcdir}":config,"{topsrcdir}"gcc:config:,g
# Add the special MPW include dirs.
-/^INCLUDES = .*$/s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/
+/^INCLUDES = /s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/
# A nasty hack to reduce confusion.
/true/s/ ; @true$//
# Fix the compile line for the generated parser.
/{CC} -c/,/echo {PARSE_C}/c\
- {CC} {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\
+ {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\
# Change all Rez commands to use mac-gcc.r.
/{REZ}/s/"{s}"[-a-zA-Z{}]*\.r/"{topsrcdir}"gcc:mac-gcc.r/