diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-10-24 07:59:41 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-10-24 07:59:41 +0000 |
commit | bb88593883c783c600c89b8d1e5d7973c90d3f5a (patch) | |
tree | 30f00d7a2377783a5112afcd6c22c5508f1c6309 /gcc/cp/decl.c | |
parent | 0f3340356d5a1b7847301b0d20161b242cfc5dbd (diff) | |
download | gcc-bb88593883c783c600c89b8d1e5d7973c90d3f5a.zip gcc-bb88593883c783c600c89b8d1e5d7973c90d3f5a.tar.gz gcc-bb88593883c783c600c89b8d1e5d7973c90d3f5a.tar.bz2 |
PR c++/12698, c++/12699, c++/12700, c++/12566
cp:
PR c++/12698, c++/12699, c++/12700, c++/12566
* cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New.
(debug_class, debug_thunks): New.
* class.c (dump_class_hierarchy_1): New break out from ...
(dump_class_hierarchy): ... here.
(dump_thunk, debug_thunks, debug_class): New.
(update_vtable_entry_for_fn): Add ssizetype casts. Correct
continued search for primary binfo via virtual.
(build_vtbl_initializer): Follow covariant thunk alias.
* method.c (make_thunk): Clear DECL_THUNKS of the thunk.
(finish_thunk): Look for an alias of the covariant thunk and point
to it.
(use_thunk): We should never use an alias.
* semantics.c (emit_associated_thunks): Do not emit aliases.
PR c++/12566
* cp-tree.h (cp_fname_init): Add TYPE pointer param.
* decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't
create an ad-hoc ERROR_MARK.
(cp_make_fname_decl): Adjust.
* pt.c (tsubst_expr): Adjust.
testsuite:
PR c++/12698, c++/12699, c++/12700, c++/12566
* g++.dg/inherit/covariant9.C: New test.
* g++.dg/inherit/covariant10.C: New test.
* g++.dg/inherit/covariant11.C: New test.
From-SVN: r72882
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1951b25..2bd6ff3 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3097,11 +3097,11 @@ cxx_init_decl_processing (void) } /* Generate an initializer for a function naming variable from - NAME. NAME may be NULL, in which case we generate a special - ERROR_MARK node which should be replaced later. */ + NAME. NAME may be NULL, to indicate a dependent name. TYPE_P is + filled in with the type of the init. */ tree -cp_fname_init (const char* name) +cp_fname_init (const char* name, tree *type_p) { tree domain = NULL_TREE; tree type; @@ -3118,12 +3118,12 @@ cp_fname_init (const char* name) type = build_qualified_type (char_type_node, TYPE_QUAL_CONST); type = build_cplus_array_type (type, domain); + *type_p = type; + if (init) TREE_TYPE (init) = type; else - /* We don't know the value until instantiation time. Make - something which will be digested now, but replaced later. */ - init = build (ERROR_MARK, type); + init = error_mark_node; return init; } @@ -3139,8 +3139,9 @@ cp_make_fname_decl (tree id, int type_dep) { const char *const name = (type_dep && processing_template_decl ? NULL : fname_as_string (type_dep)); - tree init = cp_fname_init (name); - tree decl = build_decl (VAR_DECL, id, TREE_TYPE (init)); + tree type; + tree init = cp_fname_init (name, &type); + tree decl = build_decl (VAR_DECL, id, type); /* As we're using pushdecl_with_scope, we must set the context. */ DECL_CONTEXT (decl) = current_function_decl; |