Commit 396a1d10 by Paolo Carlini

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
parent f48b4284
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> 2016-05-20 Nathan Sidwell <nathan@acm.org>
* constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
......
...@@ -3761,7 +3761,8 @@ check_for_bare_parameter_packs (tree t) ...@@ -3761,7 +3761,8 @@ check_for_bare_parameter_packs (tree t)
if (parameter_packs) 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) while (parameter_packs)
{ {
tree pack = TREE_VALUE (parameter_packs); tree pack = TREE_VALUE (parameter_packs);
...@@ -3776,9 +3777,9 @@ check_for_bare_parameter_packs (tree t) ...@@ -3776,9 +3777,9 @@ check_for_bare_parameter_packs (tree t)
name = DECL_NAME (pack); name = DECL_NAME (pack);
if (name) if (name)
inform (input_location, " %qD", name); inform (loc, " %qD", name);
else else
inform (input_location, " <anonymous>"); inform (loc, " <anonymous>");
parameter_packs = TREE_CHAIN (parameter_packs); parameter_packs = TREE_CHAIN (parameter_packs);
} }
......
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> 2016-05-23 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/fold-notshift-2.c: Adjust. * gcc.dg/fold-notshift-2.c: Adjust.
...@@ -16,7 +23,7 @@ ...@@ -16,7 +23,7 @@
* g++.dg/gomp/target-1.C: Likewise. * g++.dg/gomp/target-1.C: Likewise.
* g++.dg/gomp/target-2.C: Likewise. * g++.dg/gomp/target-2.C: Likewise.
* gcc.dg/gomp/target-1.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. * g++.dg/gomp/taskgroup-1.C: Likewise.
* gcc.dg/gomp/taskgroup-1.c: Likewise. * gcc.dg/gomp/taskgroup-1.c: Likewise.
* gcc.dg/gomp/teams-1.c: Likewise. * gcc.dg/gomp/teams-1.c: Likewise.
...@@ -38,7 +45,7 @@ ...@@ -38,7 +45,7 @@
2016-05-23 Venkataramanan Kumar <venkataramanan.kumar@amd.com> 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. * gcc.dg/vect/pr58135.c: Add new.
* gfortran.dg/pr46519-1.f: Adjust test case. * gfortran.dg/pr46519-1.f: Adjust test case.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
template <typename... T> struct A template <typename... T> struct A
{ {
void foo(T...); 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); A<int> a(0);
// { dg-do compile { target c++11 } } // { dg-do compile { target c++11 } }
template<void (*... fp)()> struct A template<void (*... fp)()> struct A
{ {
A() { fp(); } // { dg-error "not expanded|fp" } A() { fp(); } // { dg-error "11:parameter packs not expanded|fp" }
}; };
void foo(); void foo();
......
...@@ -33,7 +33,7 @@ template<typename... Args> void g(Args... args) ...@@ -33,7 +33,7 @@ template<typename... Args> void g(Args... args)
{ {
f(const_cast<const Args*>(&args)...); // okay: ``Args'' and ``args'' are expanded f(const_cast<const Args*>(&args)...); // okay: ``Args'' and ``args'' are expanded
f(5 ...); // { dg-error "contains no argument packs" } 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 } // { dg-message "args" "note" { target *-*-* } 36 }
f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f. f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f.
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
template<typename T, typename... Args> template<typename T, typename... Args>
void f(const T&, const Args&... 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> template<typename... Values>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment