diff options
author | Jason Merrill <jason@redhat.com> | 2019-08-31 18:09:47 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-08-31 18:09:47 -0400 |
commit | ad527d801855d7992e25b1548628566eefcf69e9 (patch) | |
tree | 86c87662ff59d345f1508373a2a5b3ceaddf3f1a /gcc/cp/cp-tree.h | |
parent | bd486c8cdfd943289c8c729f2dc6e0ef911bdb28 (diff) | |
download | gcc-ad527d801855d7992e25b1548628566eefcf69e9.zip gcc-ad527d801855d7992e25b1548628566eefcf69e9.tar.gz gcc-ad527d801855d7992e25b1548628566eefcf69e9.tar.bz2 |
Add source location to TRAIT_EXPR.
Since TRAIT_EXPR is exceptional, maybe_wrap_with_location won't wrap it, so
we need to put its location in the TRAIT_EXPR node itself.
* cp-tree.h (TRAIT_EXPR_LOCATION): New.
(struct tree_trait_expr): Add locus field.
* parser.c (cp_parser_trait_expr): Pass trait_loc down.
* pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
* semantics.c (finish_trait_expr): Add location parm.
* tree.c (cp_expr_location): Handle TRAIT_EXPR.
From-SVN: r275260
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 3c69e54..12eb39a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1295,10 +1295,14 @@ enum cp_trait_kind #define TRAIT_EXPR_KIND(NODE) \ (((struct tree_trait_expr *)TRAIT_EXPR_CHECK (NODE))->kind) +#define TRAIT_EXPR_LOCATION(NODE) \ + (((struct tree_trait_expr *)TRAIT_EXPR_CHECK (NODE))->locus) + struct GTY (()) tree_trait_expr { struct tree_common common; tree type1; tree type2; + location_t locus; enum cp_trait_kind kind; }; @@ -7174,7 +7178,7 @@ extern tree baselink_for_fns (tree); extern void finish_static_assert (tree, tree, location_t, bool); extern tree finish_decltype_type (tree, bool, tsubst_flags_t); -extern tree finish_trait_expr (enum cp_trait_kind, tree, tree); +extern tree finish_trait_expr (location_t, enum cp_trait_kind, tree, tree); extern tree build_lambda_expr (void); extern tree build_lambda_object (tree); extern tree begin_lambda_type (tree); |