-
- Downloads
c++: use TREE_VEC for trailing args of variadic built-in traits
This patch makes us use TREE_VEC instead of TREE_LIST to represent the trailing arguments of a variadic built-in trait. These built-ins are typically passed a simple pack expansion as the second argument, e.g. __is_constructible(T, Ts...) and the main benefit of this representation change is that substituting into this argument list is now basically free since tsubst_template_args makes sure we reuse the TREE_VEC of the corresponding ARGUMENT_PACK when expanding such a pack expansion. In the previous TREE_LIST representation we would need need to convert the expanded pack expansion into a TREE_LIST (via tsubst_tree_list). Note that an empty set of trailing arguments is now represented as an empty TREE_VEC instead of NULL_TREE, so now TRAIT_TYPE/EXPR_TYPE2 will be empty only for unary traits. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Convert a TREE_VEC of arguments into a TREE_LIST for sake of pretty printing. * cxx-pretty-print.cc (pp_cxx_trait): Handle TREE_VEC instead of TREE_LIST of trailing variadic trait arguments. * method.cc (constructible_expr): Likewise. (is_xible_helper): Likewise. * parser.cc (cp_parser_trait): Represent trailing variadic trait arguments as a TREE_VEC instead of TREE_LIST. * pt.cc (value_dependent_expression_p): Handle TREE_VEC instead of TREE_LIST of trailing variadic trait arguments. * semantics.cc (finish_type_pack_element): Likewise. (check_trait_type): Likewise.
Showing
- gcc/cp/constraint.cc 10 additions, 0 deletionsgcc/cp/constraint.cc
- gcc/cp/cxx-pretty-print.cc 3 additions, 3 deletionsgcc/cp/cxx-pretty-print.cc
- gcc/cp/method.cc 9 additions, 8 deletionsgcc/cp/method.cc
- gcc/cp/parser.cc 8 additions, 6 deletionsgcc/cp/parser.cc
- gcc/cp/pt.cc 4 additions, 5 deletionsgcc/cp/pt.cc
- gcc/cp/semantics.cc 9 additions, 6 deletionsgcc/cp/semantics.cc
Loading
Please register or sign in to comment