The attached patch finishes the semantics for requires expressions. It
includes reduction rules for constraint decomposition, substitution
rules, and diagnostics.

Andrew


Changelog:

2013-07-11  Andrew Sutton  <andrew.n.sut...@gmail.com>
        * gcc/cp/cp-tree.h (declare_local_parms): New
        * gcc/cp/cp-tree.h (finish_validtype_expr): Fixed typo.
        * gcc/cp/semantics.c (potential_constant_expr): Return true for
         requirements.
        (finish_requires_expr): Actually evaluate when we are not processing
        a template decl.
        * pt.c (tsubst_requires_expr): New, along with helper functions for
        instantiating requires parameters.
        (tsubst_validexpr_expr): New.
        (tsubst_validtype_expr): New.
        (tsubst_constexpr_expr): New.
        (tsubst_expr_req): New.
        (tsubst_type_req): New.
        (tsubst_nested_req): New.
        (tsubst_copy_and_build): Substitution rules for requirements.
        (instantiate_requirements): Do not require a constant expression.
        * constraint.cc (redcue_requires): Reduction rules for requires
        expressions and requirement nodes.
        (reduce_stmt_list): Remove redundant checks.
        (diagnose_requires): Diagnose failures in requires expressions and
        specific kinds of expressions.
        * gcc/cp/cxx-pretty-print.c (pp_cxx_primary_expression): Pretty print
        expressions related to requirements
        (pp_cxx_requirement_parameter_list). Clean up implementation.
        * gcc/cp/cxx-pretty-print.h (pp_cxx_requirement_parameter_list): New,
        along with pretty printers for requirements-related expressions.
        * gcc/cp/error.c (dump_expr): Dump expressions related to requirements.
        (reqparms_to_string): New.
        (cp_printer): Use %Z to print a list of parameters.

Attachment: reqexpr-6.patch
Description: Binary data

Reply via email to