mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
Check is_capture_proxy sooner
...and don't check !normal.
This commit is contained in:
@@ -134,6 +134,14 @@ get_reflection (location_t loc, tree t, reflect_kind kind/*=REFLECT_UNDEF*/)
|
||||
"parameter %qD", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
/* If the id-expression denotes a variable declared by an init-capture,
|
||||
R is ill-formed. */
|
||||
else if (is_capture_proxy (t))
|
||||
{
|
||||
error_at (loc, "%<^^%> cannot be applied to a local entity declared "
|
||||
"by init-capture");
|
||||
return error_mark_node;
|
||||
}
|
||||
/* If the id-expression denotes a local parameter introduced by
|
||||
a requires-expression, R is ill-formed. */
|
||||
else if (TREE_CODE (t) == PARM_DECL && CONSTRAINT_VAR_P (t))
|
||||
@@ -159,14 +167,6 @@ get_reflection (location_t loc, tree t, reflect_kind kind/*=REFLECT_UNDEF*/)
|
||||
inform (DECL_SOURCE_LOCATION (t), "%qD declared here", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
/* If the id-expression denotes a variable declared by an init-capture,
|
||||
R is ill-formed. */
|
||||
else if (is_capture_proxy (t) && !is_normal_capture_proxy (t))
|
||||
{
|
||||
error_at (loc, "%<^^%> cannot be applied to a local entity declared "
|
||||
"by init-capture");
|
||||
return error_mark_node;
|
||||
}
|
||||
/* If lookup finds a declaration that replaced a using-declarator during
|
||||
a single search, R is ill-formed. */
|
||||
else if (TREE_CODE (t) == USING_DECL
|
||||
|
||||
@@ -43,7 +43,7 @@ h ()
|
||||
constexpr auto r3 = ^^y; // { dg-error "intervening lambda expression" }
|
||||
|
||||
[x_]() {
|
||||
constexpr auto r4 = ^^x_; // { dg-error "intervening lambda expression" }
|
||||
constexpr auto r4 = ^^x_; // { dg-error "local entity declared by init-capture" }
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user