From: Paolo Carlini Date: Mon, 23 May 2016 19:20:41 +0000 (+0000) Subject: pt.c (check_for_bare_parameter_packs): Improve error message location for expressions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=396a1d10b3822a6da4794309a28ce3b1ea309325;p=gcc.git pt.c (check_for_bare_parameter_packs): Improve error message location for expressions. /cp 2016-05-23 Paolo Carlini * pt.c (check_for_bare_parameter_packs): Improve error message location for expressions. /testsuite 2016-05-23 Paolo Carlini * g++.dg/cpp0x/pr31445.C: Test column number too. * g++.dg/cpp0x/pr32253.C: Likewise. * g++.dg/cpp0x/variadic-ex13.C: Likewise. * g++.dg/cpp0x/variadic36.C: Likewise. From-SVN: r236609 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9618a28dadd..e6f4ac98f9f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-05-23 Paolo Carlini + + * pt.c (check_for_bare_parameter_packs): Improve error message + location for expressions. + 2016-05-20 Nathan Sidwell * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2bba571b97e..2ce8f40f791 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3761,7 +3761,8 @@ check_for_bare_parameter_packs (tree t) if (parameter_packs) { - error ("parameter packs not expanded with %<...%>:"); + location_t loc = EXPR_LOC_OR_LOC (t, input_location); + error_at (loc, "parameter packs not expanded with %<...%>:"); while (parameter_packs) { tree pack = TREE_VALUE (parameter_packs); @@ -3776,9 +3777,9 @@ check_for_bare_parameter_packs (tree t) name = DECL_NAME (pack); if (name) - inform (input_location, " %qD", name); + inform (loc, " %qD", name); else - inform (input_location, " "); + inform (loc, " "); parameter_packs = TREE_CHAIN (parameter_packs); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4d39198acd3..b4ca509c2e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2016-05-23 Paolo Carlini + + * g++.dg/cpp0x/pr31445.C: Test column number too. + * g++.dg/cpp0x/pr32253.C: Likewise. + * g++.dg/cpp0x/variadic-ex13.C: Likewise. + * g++.dg/cpp0x/variadic36.C: Likewise. + 2016-05-23 Marc Glisse * gcc.dg/fold-notshift-2.c: Adjust. @@ -16,7 +23,7 @@ * g++.dg/gomp/target-1.C: Likewise. * g++.dg/gomp/target-2.C: Likewise. * gcc.dg/gomp/target-1.c: Likewise. - * gcc.dg/gomp/target-2.c: Likewise. + * gcc.dg/gomp/target-2.c: Likewise. * g++.dg/gomp/taskgroup-1.C: Likewise. * gcc.dg/gomp/taskgroup-1.c: Likewise. * gcc.dg/gomp/teams-1.c: Likewise. @@ -38,7 +45,7 @@ 2016-05-23 Venkataramanan Kumar - * gcc.dg/vect/bb-slp-19.c: Remove XFAIL. + * gcc.dg/vect/bb-slp-19.c: Remove XFAIL. * gcc.dg/vect/pr58135.c: Add new. * gfortran.dg/pr46519-1.f: Adjust test case. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31445.C b/gcc/testsuite/g++.dg/cpp0x/pr31445.C index 89aae9a8578..b4542818237 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr31445.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr31445.C @@ -2,7 +2,7 @@ template struct A { void foo(T...); - A(T... t) { foo(t); } // { dg-error "parameter packs|t" } + A(T... t) { foo(t); } // { dg-error "18:parameter packs|t" } }; A a(0); diff --git a/gcc/testsuite/g++.dg/cpp0x/pr32253.C b/gcc/testsuite/g++.dg/cpp0x/pr32253.C index 2094b2d981f..bfb11e42d8f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr32253.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr32253.C @@ -1,7 +1,7 @@ // { dg-do compile { target c++11 } } template struct A { - A() { fp(); } // { dg-error "not expanded|fp" } + A() { fp(); } // { dg-error "11:parameter packs not expanded|fp" } }; void foo(); diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C index fe29e717618..ddf71a42fc3 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C @@ -33,7 +33,7 @@ template void g(Args... args) { f(const_cast(&args)...); // okay: ``Args'' and ``args'' are expanded f(5 ...); // { dg-error "contains no argument packs" } - f(args); // { dg-error "parameter packs not expanded" } + f(args); // { dg-error "5:parameter packs not expanded" } // { dg-message "args" "note" { target *-*-* } 36 } f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f. } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic36.C b/gcc/testsuite/g++.dg/cpp0x/variadic36.C index c60e6d0576c..0bd068cee05 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic36.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic36.C @@ -2,7 +2,7 @@ template void f(const T&, const Args&... args) { - f(args); // { dg-error "packs not expanded" } + f(args); // { dg-error "4:parameter packs not expanded" } } template