Add source location to TRAIT_EXPR.
authorJason Merrill <jason@redhat.com>
Sat, 31 Aug 2019 22:09:47 +0000 (18:09 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 31 Aug 2019 22:09:47 +0000 (18:09 -0400)
commitad527d801855d7992e25b1548628566eefcf69e9
tree86c87662ff59d345f1508373a2a5b3ceaddf3f1a
parentbd486c8cdfd943289c8c729f2dc6e0ef911bdb28
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
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/testsuite/g++.dg/ext/is_class_error3.C [new file with mode: 0644]