diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-15 15:09:42 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-15 15:09:42 +0000 |
commit | 1f93c018f2b896c143db6b3659e6d5f42f7ec1fb (patch) | |
tree | 4c40e08625acb5638671b72992b7c2e32dd985b5 /gcc/cp | |
parent | 62588f4e87014268faa8b0b3d0fb266bb1023490 (diff) | |
download | gcc-1f93c018f2b896c143db6b3659e6d5f42f7ec1fb.tar.gz |
PR c/35751
* c-decl.c (finish_decl): If extern or static var has variable
size, set TREE_TYPE (decl) to error_mark_node.
* decl.c (layout_var_decl): If extern or static var has variable
size, set TREE_TYPE (decl) to error_mark_node.
* gcc.dg/gomp/pr35751.c: New test.
* g++.dg/gomp/pr35751.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134317 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 24 | ||||
-rw-r--r-- | gcc/cp/decl.c | 5 |
2 files changed, 19 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cee41d5fbdb..22a7420523d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-04-15 Jakub Jelinek <jakub@redhat.com> + + PR c/35751 + * decl.c (layout_var_decl): If extern or static var has variable + size, set TREE_TYPE (decl) to error_mark_node. + 2008-04-16 Danny Smith <dannysmith@users.sourceforge.net> PR target/35921 @@ -2334,7 +2340,7 @@ 2007-09-05 Jan Hubicka <jh@suse.cz> - * cp/sematics.c (expand_body): Remove unnecesary import_export_decl + * sematics.c (expand_body): Remove unnecesary import_export_decl call, DECL_EXTERNAL checks and current_function_decl saving. 2007-09-05 Paolo Carlini <pcarlini@suse.de> @@ -2761,7 +2767,7 @@ * cp-objcp-common.c (cxx_get_alias_set): Change return type to alias_set_type. - * cp/cp-tree.h (cxx_get_alias_set): Update declaration. + * cp-tree.h (cxx_get_alias_set): Update declaration. 2007-08-10 Ollie Wild <aaw@google.com> @@ -3434,7 +3440,7 @@ 2007-05-11 Silvius Rus <rus@google.com> - * cp/typeck.c (build_indirect_ref): Add call to + * typeck.c (build_indirect_ref): Add call to strict_aliasing_warning. (build_reinterpret_cast_1): Condition call to strict_aliasing_warning. @@ -3524,7 +3530,7 @@ 2007-04-23 Jan Hubicka <jh@suse.cz> - * cp/decl2.c (finish_objects): Do not call target constructor/destructor + * decl2.c (finish_objects): Do not call target constructor/destructor bits dirrectly. 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com> @@ -3546,7 +3552,7 @@ 2007-04-16 Seongbae Park <seongbae.park@gmail.com> PR c++/29365 - * cp/decl2.c (constrain_class_visibility): + * decl2.c (constrain_class_visibility): Do not warn about the use of anonymous namespace in the main input file. 2007-04-15 Mark Mitchell <mark@codesourcery.com> @@ -3565,7 +3571,7 @@ 2007-04-11 Jan Hubicka <jh@suse.cz> - * cp/class.c (convert_to_base_statically): Fold produced tree; verify + * class.c (convert_to_base_statically): Fold produced tree; verify that we are not processing template_decl. 2007-04-09 Mark Mitchell <mark@codesourcery.com> @@ -3820,7 +3826,7 @@ 2007-03-14 Dirk Mueller <dmueller@suse.de> - * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning. + * semantics.c (c_finish_if_stmt): Call empty_if_body_warning. (finish_do_body): Warn about empty body in do/while statement. 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> @@ -3835,7 +3841,7 @@ 2007-03-13 Alexandre Oliva <aoliva@redhat.com> - * cp/repo.c (init_repo): Initialize random_seed saved options. + * repo.c (init_repo): Initialize random_seed saved options. (finish_repo): Adjust. 2007-03-13 Mark Mitchell <mark@codesourcery.com> @@ -4089,7 +4095,7 @@ 2007-03-09 Dirk Mueller <dmueller@suse.de> - * cp/call.c (build_new_op): Call warn_logical_operator. + * call.c (build_new_op): Call warn_logical_operator. 2007-03-08 Volker Reichelt <reichelt@netcologne.de> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ccdcf379544..66e8f426b63 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4442,7 +4442,10 @@ layout_var_decl (tree decl) if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) constant_expression_warning (DECL_SIZE (decl)); else - error ("storage size of %qD isn't constant", decl); + { + error ("storage size of %qD isn't constant", decl); + TREE_TYPE (decl) = error_mark_node; + } } } |