diff options
author | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-03-24 16:13:12 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-03-24 16:13:12 +0000 |
commit | aa09da44c7f7974aa79e2e409b86be215fef95b7 (patch) | |
tree | e624fb2b59a8240867b11734d6669841a9a9db75 | |
parent | ae16ec5f2c93d51d755ea453b4c4efa5e3557e97 (diff) | |
download | gcc-aa09da44c7f7974aa79e2e409b86be215fef95b7.zip gcc-aa09da44c7f7974aa79e2e409b86be215fef95b7.tar.gz gcc-aa09da44c7f7974aa79e2e409b86be215fef95b7.tar.bz2 |
tree.c (mapcar): When dealing with a DECL, use it's constant value, if any.
�
* tree.c (mapcar): When dealing with a DECL, use it's constant
value, if any.
* pt.c (lookup_template_class): Don't mangle the names of template
classes whose arguments are unknown.
* pt.c (tsubst_expr): Handle GOTO_STMT correctly.
From-SVN: r18804
-rw-r--r-- | gcc/cp/pt.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/goto.C | 12 |
2 files changed, 20 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2e44007..7685f48 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2827,7 +2827,7 @@ lookup_template_class (d1, arglist, in_decl, context) /* We need to set this again after CLASSTYPE_TEMPLATE_INFO is set up. */ DECL_ASSEMBLER_NAME (TYPE_MAIN_DECL (t)) = id; - /* if (! uses_template_parms (arglist)) */ + if (! uses_template_parms (arglist)) DECL_ASSEMBLER_NAME (TYPE_MAIN_DECL (t)) = get_identifier (build_overload_name (t, 1, 1)); @@ -5077,8 +5077,13 @@ tsubst_expr (t, args, in_decl) case GOTO_STMT: lineno = TREE_COMPLEXITY (t); - finish_goto_stmt (tsubst_expr (GOTO_DESTINATION (t), - args, in_decl)); + t = GOTO_DESTINATION (t); + if (TREE_CODE (t) != IDENTIFIER_NODE) + /* Computed goto's must be tsubst'd into. On the other hand, + non-computed gotos must not be; the identifier in question + will have no binding. */ + t = tsubst_expr (t, args, in_decl); + finish_goto_stmt (t); break; case ASM_STMT: diff --git a/gcc/testsuite/g++.old-deja/g++.pt/goto.C b/gcc/testsuite/g++.old-deja/g++.pt/goto.C new file mode 100644 index 0000000..c6c1a56 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/goto.C @@ -0,0 +1,12 @@ +// Build don't link: + +template<class T> +void compute(T) { + goto Exit; +Exit: ; + } + +int main() +{ + compute(0); +} |