aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-03-18 08:38:00 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-03-18 08:38:00 -0500
commit001ad76c41fb6725f6834c063199e8ea6540a9ee (patch)
tree2bd991137adb35d42fadc965e98075d6924e3786 /gcc/cp/mangle.c
parented2fa43249ffb8c69499cc8bdcadb611ccf9762a (diff)
downloadgcc-001ad76c41fb6725f6834c063199e8ea6540a9ee.zip
gcc-001ad76c41fb6725f6834c063199e8ea6540a9ee.tar.gz
gcc-001ad76c41fb6725f6834c063199e8ea6540a9ee.tar.bz2
re PR c++/4377 (more errors with multiple non-type template parameters)
PR c++/4377 * mangle.c (write_expression): Strip NOP_EXPRs sooner. Also strip NON_LVALUE_EXPRs. From-SVN: r50967
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 623fc3d..a71cc00 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1788,6 +1788,16 @@ write_expression (expr)
code = TREE_CODE (expr);
}
+ /* Skip NOP_EXPRs. They can occur when (say) a pointer argument
+ is converted (via qualification conversions) to another
+ type. */
+ while (TREE_CODE (expr) == NOP_EXPR
+ || TREE_CODE (expr) == NON_LVALUE_EXPR)
+ {
+ expr = TREE_OPERAND (expr, 0);
+ code = TREE_CODE (expr);
+ }
+
/* Handle template parameters. */
if (code == TEMPLATE_TYPE_PARM
|| code == TEMPLATE_TEMPLATE_PARM
@@ -1807,15 +1817,6 @@ write_expression (expr)
{
int i;
- /* Skip NOP_EXPRs. They can occur when (say) a pointer argument
- is converted (via qualification conversions) to another
- type. */
- while (TREE_CODE (expr) == NOP_EXPR)
- {
- expr = TREE_OPERAND (expr, 0);
- code = TREE_CODE (expr);
- }
-
/* When we bind a variable or function to a non-type template
argument with reference type, we create an ADDR_EXPR to show
the fact that the entity's address has been taken. But, we