From: Andrea Azzarone Date: Tue, 14 Jul 2015 22:36:50 +0000 (+0000) Subject: re PR c++/65071 (ICE on valid, sizeof...() of template template parameter pack in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=973590f32087d0b9d5330d9a14a066b18a4ca832;p=gcc.git re PR c++/65071 (ICE on valid, sizeof...() of template template parameter pack in return type) /cp 2015-07-14 Andrea Azzarone PR c++/65071 * parser.c (cp_parser_sizeof_pack): Also consider template template parameters. /testsuite 2015-07-14 Andrea Azzarone PR c++/65071 * g++.dg/cpp0x/vt-65071.C: New. From-SVN: r225793 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 904fc76386f..ec50f75558c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-07-14 Andrea Azzarone + + PR c++/65071 + * parser.c (cp_parser_sizeof_pack): Also consider template template + parameters. + 2015-07-14 Jason Merrill * call.c (build_new_method_call_1): Call reshape_init. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f4e1ee11c7b..574ffba3ece 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -24468,7 +24468,7 @@ cp_parser_sizeof_pack (cp_parser *parser) if (expr == error_mark_node) cp_parser_name_lookup_error (parser, name, expr, NLE_NULL, token->location); - if (TREE_CODE (expr) == TYPE_DECL) + if (TREE_CODE (expr) == TYPE_DECL || TREE_CODE (expr) == TEMPLATE_DECL) expr = TREE_TYPE (expr); else if (TREE_CODE (expr) == CONST_DECL) expr = DECL_INITIAL (expr); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6dd4feb719d..e7a38b51ecc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-14 Andrea Azzarone + + PR c++/65071 + * g++.dg/cpp0x/vt-65071.C: New. + 2015-07-14 Sandra Loosemore Cesar Philippidis Chung-Lin Tang diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-65071.C b/gcc/testsuite/g++.dg/cpp0x/vt-65071.C new file mode 100644 index 00000000000..727ad790828 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-65071.C @@ -0,0 +1,9 @@ +// PR c++/65071 +// { dg-do compile { target c++11 } } + +template struct S {}; + +template class... T, int N> +S foo(T...); + +auto x = foo(S<2>{});