diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/pt.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/alias-decl-pr96805.C | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9a83810..555dc47 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -13451,7 +13451,8 @@ tsubst_aggr_type (tree t, complain, in_decl); if (argvec == error_mark_node) r = error_mark_node; - else if (cxx_dialect >= cxx17 && dependent_scope_p (context)) + else if (!entering_scope + && cxx_dialect >= cxx17 && dependent_scope_p (context)) { /* See maybe_dependent_member_ref. */ tree name = TYPE_IDENTIFIER (t); @@ -14160,7 +14161,11 @@ tsubst_template_decl (tree t, tree args, tsubst_flags_t complain, class_p = true; inner = TREE_TYPE (inner); } - inner = tsubst (inner, args, complain, in_decl); + if (class_p) + inner = tsubst_aggr_type (inner, args, complain, + in_decl, /*entering*/1); + else + inner = tsubst (inner, args, complain, in_decl); } --processing_template_decl; if (inner == error_mark_node) diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-pr96805.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pr96805.C new file mode 100644 index 0000000..c784f27 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pr96805.C @@ -0,0 +1,9 @@ +// PR c++/96805 +// { dg-do compile { target c++11 } } + +template <typename T> class a { + template <int N> struct c { + template <bool B> using t = int; + t<N> m; + }; +}; |