Now that the condition includes all captures, let's not talk about
init-capture. Also print the decl.
gcc/cp/ChangeLog:
* reflect.cc (get_reflection): Adjust the error message for the
is_capture_proxy check.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/expr6.C: Adjust dg-error.
Reviewed-by: Jason Merrill <jason@redhat.com>
R is ill-formed. */
else if (is_capture_proxy (t))
{
- error_at (loc, "%<^^%> cannot be applied to a local entity declared "
- "by init-capture");
+ error_at (loc, "%<^^%> cannot be applied to a capture %qD", t);
return error_mark_node;
}
/* If the id-expression denotes a local parameter introduced by
int y = 42;
[x_=x, y]() {
constexpr auto r1 = ^^x; // { dg-error "intervening lambda expression" }
- constexpr auto r2 = ^^x_; // { dg-error "local entity declared by init-capture" }
+ constexpr auto r2 = ^^x_; // { dg-error "cannot be applied to a capture .x_." }
constexpr auto r3 = ^^y; // { dg-error "intervening lambda expression" }
[x_]() {
- constexpr auto r4 = ^^x_; // { dg-error "local entity declared by init-capture" }
+ constexpr auto r4 = ^^x_; // { dg-error "cannot be applied to a capture .x_." }
};
};
}