===================================================================
@@ -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);
}
===================================================================
@@ -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);
===================================================================
@@ -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();
===================================================================
@@ -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.
}
===================================================================
@@ -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>