diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-13 13:46:39 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-13 13:46:39 -0500 |
commit | 9dd90d8e354751116b280bfb6884d3bdd7c6dc59 (patch) | |
tree | e2fb747e8b0b8b0a7b85cf6e61850b22b6937092 /gcc/cp | |
parent | 2b32c27d98a24ef789729ded2e0c42108a9ea9e9 (diff) | |
download | gcc-9dd90d8e354751116b280bfb6884d3bdd7c6dc59.zip gcc-9dd90d8e354751116b280bfb6884d3bdd7c6dc59.tar.gz gcc-9dd90d8e354751116b280bfb6884d3bdd7c6dc59.tar.bz2 |
re PR c++/29363 (ICE throwing undeclared object)
PR c++/29363
* decl.c (create_implicit_typedef): Set TYPE_STUB_DECL here.
(cxx_init_decl_processing): Not here.
* name-lookup.c (pushtag): Or here.
* pt.c (lookup_template_class): Or here.
From-SVN: r154163
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 1 | ||||
-rw-r--r-- | gcc/cp/pt.c | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d4c44a5..722c983 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2009-11-13 Jason Merrill <jason@redhat.com> + PR c++/29363 + * decl.c (create_implicit_typedef): Set TYPE_STUB_DECL here. + (cxx_init_decl_processing): Not here. + * name-lookup.c (pushtag): Or here. + * pt.c (lookup_template_class): Or here. + PR c++/35075 * pt.c (convert_nontype_argument): Give helpful error about reference variable argument to reference template parameter. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e23634f..0375dd5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -849,6 +849,7 @@ create_implicit_typedef (tree name, tree type) amongst these. */ SET_DECL_IMPLICIT_TYPEDEF_P (decl); TYPE_NAME (type) = decl; + TYPE_STUB_DECL (type) = decl; return decl; } @@ -3456,7 +3457,6 @@ cxx_init_decl_processing (void) bad_alloc_decl = create_implicit_typedef (bad_alloc_id, bad_alloc_type_node); DECL_CONTEXT (bad_alloc_decl) = current_namespace; - TYPE_STUB_DECL (bad_alloc_type_node) = bad_alloc_decl; pop_namespace (); ptr_ftype_sizetype diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 14f9787..6b8dcc7 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5288,7 +5288,6 @@ pushtag (tree name, tree type, tag_scope scope) decl = TYPE_NAME (type); gcc_assert (TREE_CODE (decl) == TYPE_DECL); - TYPE_STUB_DECL (type) = decl; /* Set type visibility now if this is a forward declaration. */ TREE_PUBLIC (decl) = 1; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c799368..540f577 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6371,7 +6371,6 @@ lookup_template_class (tree d1, type_decl = create_implicit_typedef (DECL_NAME (gen_tmpl), t); DECL_CONTEXT (type_decl) = TYPE_CONTEXT (t); - TYPE_STUB_DECL (t) = type_decl; DECL_SOURCE_LOCATION (type_decl) = DECL_SOURCE_LOCATION (TYPE_STUB_DECL (template_type)); } |