diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-03-01 14:01:39 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-03-01 14:01:39 +0000 |
commit | fbfe8c9e5ab2168a5776947525909c485afe39f3 (patch) | |
tree | a3ac89d597d4b0217d02828d183a010e6bea8ec0 /gcc/cp/pt.c | |
parent | 4d24a8896575dfb50d733d1213dbe00bb6df3ab3 (diff) | |
download | gcc-fbfe8c9e5ab2168a5776947525909c485afe39f3.zip gcc-fbfe8c9e5ab2168a5776947525909c485afe39f3.tar.gz gcc-fbfe8c9e5ab2168a5776947525909c485afe39f3.tar.bz2 |
Implement using decls inside template functions.
cp:
Implement using decls inside template functions.
* decl2.c (validate_nonmember_using_decl): Don't special case
fake_std_node in the global namespace. Don't reject early when
processing a template.
(do_local_using_decl): Add to statement tree. Don't do further
processing when building a template.
* pt.c (tsubst_expr, DECL_STMT case): Deal with USING_DECLs.
testsuite:
* g++.old-deja/g++.pt/using1.C: New test.
From-SVN: r40151
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 331b307..0994d67 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7299,6 +7299,14 @@ tsubst_expr (t, args, complain, in_decl) decl = DECL_STMT_DECL (t); if (TREE_CODE (decl) == LABEL_DECL) finish_label_decl (DECL_NAME (decl)); + else if (TREE_CODE (decl) == USING_DECL) + { + tree scope = DECL_INITIAL (decl); + tree name = DECL_NAME (decl); + + scope = tsubst_expr (scope, args, complain, in_decl); + do_local_using_decl (build_nt (SCOPE_REF, scope, name)); + } else { init = DECL_INITIAL (decl); |