From 5d69ba1faa7a74aaa44795573aa89ebb834c16d0 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 2 Jul 2002 03:19:22 +0000 Subject: 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 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/mangle.c | 7 +++++++ gcc/cp/operators.def | 6 +----- gcc/testsuite/ChangeLog | 5 +++++ 4 files changed, 20 insertions(+), 5 deletions(-) (limited to 'gcc') 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 + + 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 * 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 - 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 + + PR c++/7112 + * g++.dg/template/sizeof2.C: New test. + 2002-07-01 Neil Booth * gcc.dg/cpp/trad/cmdlne-dD.c, gcc.dg/cpp/trad/cmdlne-dM.c, -- cgit v1.1