pt.c (check_for_bare_parameter_packs): Improve error message location for expressions.

/cp
2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>

	* pt.c (check_for_bare_parameter_packs): Improve error message
	location for expressions.

/testsuite
2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>

	* 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
This commit is contained in:
Paolo Carlini 2016-05-23 19:20:41 +00:00
parent f48b428431
commit 396a1d10b3
7 changed files with 22 additions and 9 deletions

View file

@ -1,3 +1,8 @@
2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (check_for_bare_parameter_packs): Improve error message
location for expressions.
2016-05-20 Nathan Sidwell <nathan@acm.org>
* constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if

View file

@ -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, " <anonymous>");
inform (loc, " <anonymous>");
parameter_packs = TREE_CHAIN (parameter_packs);
}

View file

@ -1,3 +1,10 @@
2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
* 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 <marc.glisse@inria.fr>
* 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 <venkataramanan.kumar@amd.com>
* 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.

View file

@ -2,7 +2,7 @@
template <typename... T> 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<int> a(0);

View file

@ -1,7 +1,7 @@
// { dg-do compile { target c++11 } }
template<void (*... fp)()> struct A
{
A() { fp(); } // { dg-error "not expanded|fp" }
A() { fp(); } // { dg-error "11:parameter packs not expanded|fp" }
};
void foo();

View file

@ -33,7 +33,7 @@ template<typename... Args> void g(Args... args)
{
f(const_cast<const Args*>(&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.
}

View file

@ -2,7 +2,7 @@
template<typename T, typename... Args>
void f(const T&, const Args&... args)
{
f(args); // { dg-error "packs not expanded" }
f(args); // { dg-error "4:parameter packs not expanded" }
}
template<typename... Values>