From: Jason Merrill Date: Thu, 16 Jun 2011 22:05:46 +0000 (-0400) Subject: re PR c++/49420 ([C++0x] compiler segfault using result_of) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89a27d8fa26ed41071db524875a00086fac9002a;p=gcc.git re PR c++/49420 ([C++0x] compiler segfault using result_of) PR c++/49420 * error.c (dump_template_argument): Don't try to omit default template args from an argument pack. From-SVN: r175117 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ed50863a37..6523c940623 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-06-16 Jason Merrill + + PR c++/49420 + * error.c (dump_template_argument): Don't try to omit default + template args from an argument pack. + 2011-06-15 H.J. Lu PR c++/49412 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 22470dca055..7c90ec45c17 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -147,7 +147,9 @@ static void dump_template_argument (tree arg, int flags) { if (ARGUMENT_PACK_P (arg)) - dump_template_argument_list (ARGUMENT_PACK_ARGS (arg), flags); + dump_template_argument_list (ARGUMENT_PACK_ARGS (arg), + /* No default args in argument packs. */ + flags|TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS); else if (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL) dump_type (arg, flags & ~TFF_CLASS_KEY_OR_ENUM); else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bea872172d5..6622a60311d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-16 Jason Merrill + + PR c++/49420 + * g++.dg/cpp0x/variadic112.C: New. + 2011-06-16 Jeff Law * gcc.dg/builtin-object-size-1.c: Update to handle chances from diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic112.C b/gcc/testsuite/g++.dg/cpp0x/variadic112.C new file mode 100644 index 00000000000..1640657d950 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic112.C @@ -0,0 +1,19 @@ +// PR c++/49420 +// { dg-options -std=c++0x } + +struct A { }; + +template struct B +{ + typedef typename T::type type ; // { dg-error "no type" } +}; + +template +typename B::type +get(const Array& a, Args... args); + +int main() +{ + A a; + int x = get(a, 1, 2, 3); // { dg-error "no match" } +}