diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-07-02 03:19:22 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-07-02 03:19:22 +0000 |
commit | 5d69ba1faa7a74aaa44795573aa89ebb834c16d0 (patch) | |
tree | 8a402d57cf27037db16d46abdc1f0c6a8166faac /gcc | |
parent | 68a830fe3a4d760b2a991c706aa12f4716015ec5 (diff) | |
download | gcc-5d69ba1faa7a74aaa44795573aa89ebb834c16d0.zip gcc-5d69ba1faa7a74aaa44795573aa89ebb834c16d0.tar.gz gcc-5d69ba1faa7a74aaa44795573aa89ebb834c16d0.tar.bz2 |
re PR c++/7112 (Regression: ICE on C++ code involving templates and sizeof)
PR c++/7112
* g++.dg/template/sizeof2.C: New test.
PR c++/7112
* mangle.c (write_expression): Add mangling for sizeof when
applied to a type.
* operators.def: Remove stale comment.
* cp-demangle.c (demangle_operator_name): Add type_arg parameter.
Set it for the "st" operator.
(demangle_expression): Handle expressions with types as arguments.
From-SVN: r55169
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 7 | ||||
-rw-r--r-- | gcc/cp/operators.def | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 |
4 files changed, 20 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 18814cf..27ee091 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2002-07-01 Mark Mitchell <mark@codesourcery.com> + + PR c++/7112 + * mangle.c (write_expression): Add mangling for sizeof when + applied to a type. + * operators.def: Remove stale comment. + 2002-06-30 Nathan Sidwell <nathan@codesourcery.com> * cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ... diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index ae5714a..fc92d6e 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1834,6 +1834,12 @@ write_expression (expr) write_mangled_name (expr); write_char ('E'); } + else if (TREE_CODE (expr) == SIZEOF_EXPR + && TYPE_P (TREE_OPERAND (expr, 0))) + { + write_string ("st"); + write_type (TREE_OPERAND (expr, 0)); + } else { int i; @@ -1872,6 +1878,7 @@ write_expression (expr) write_expression (TREE_OPERAND (expr, 0)); break; + /* Handle pointers-to-members specially. */ case SCOPE_REF: write_type (TREE_OPERAND (expr, 0)); diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def index 775f59d..8504380 100644 --- a/gcc/cp/operators.def +++ b/gcc/cp/operators.def @@ -5,7 +5,7 @@ non-overloadable operators (like the `?:' ternary operator). Writtey by Mark Mitchell <mark@codesourcery.com> - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -46,10 +46,6 @@ Boston, MA 02111-1307, USA. */ mangled under the new ABI. For `operator +', for example, this would be "pl". - OLD_MANGLING - - Analogous, but for the old ABI. - ARITY The arity of the operator, or -1 if any arity is allowed. (As diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d601f14..b7cb0f2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-07-01 Mark Mitchell <mark@codesourcery.com> + + PR c++/7112 + * g++.dg/template/sizeof2.C: New test. + 2002-07-01 Neil Booth <neil@daikokuya.co.uk> * gcc.dg/cpp/trad/cmdlne-dD.c, gcc.dg/cpp/trad/cmdlne-dM.c, |