Merge from trunk.
[official-gcc.git] / ChangeLog.concepts
blob2474f2b3822dd9aeef945c82f5e40d9ccf227623
1 2013-13-04  Andrew Sutton  <andrew.n.sutton@gmail.com>
2         * gcc/testsuite/g++.dg/concepts/concepts.exp: New.
4 2013-11-12  Andrew Sutton  <andrew.n.sutton@gmail.com>
5         * gcc/cp/parser.c (synthesize_implicit_template_parm): Allow concepts
6         to declare implicit template parameters. Only synthesize new parameters
7         if the concept name is new.
8         (finish_concept_name): Moving into parser.c for the time being. Needs
9         to be rewritten to remove duplicate code between parser.c and
10         constraint.cc.
12 2013-11-12  Andrew Sutton  <andrew.n.sutton@gmail.com>
13         * gcc/cp/pt.c (tsubst_copy): Expand pack expansions as conjunctions.
15 2013-11-12  Andrew Sutton  <andrew.n.sutton@gmail.com>
16         * gcc/cp/pt.c (tsubst_pack_conjunction): Don't try to conjoin
17         dependent expressions.
19 2013-11-12  Andrew Sutton  <andrew.n.sutton@gmail.com>
20         * gcc/cp/semantics.c (fixup_template_type): Compare primary template
21         types to specializations using structural types so we don't run into
22         canonical type errors with constrained specializations.
24 2013-11-08  Andrew Sutton  <andrew.n.sutton@gmail.com>
25         * gcc/cp/pt.c (add_inherited_template_parms): Instantiate requirements
26         in a processing template decl context.
28 2013-11-05  Andrew Sutton  <andrew.n.sutton@gmail.com>
29         * gcc/cp/semantics.c (fixup_template_type): Add a same-type check
30         for specialiations so we don't accidentally match non-dependent
31         specializations having a different type.
33 2013-10-26  Ville Voutilainen  <ville.voutilainen@gmail.com>
34         * gcc/cp/decl.c (grokdeclarator): Reject concept keyword
35         in typedefs, function parameters, data members, non-static
36         member functions and variables. Allow static member functions
37         to be concepts.
39 2013-10-30  Andrew Sutton  <andrew.n.sutton@gmail.com>
40         * gcc/cp/semantics.c (fixup_template_type): Don't emit errors when
41         no templates can be found with matching constraints.
43 2013-10-25  Andrew Sutton  <andrew.n.sutton@gmail.com>
44         * gcc/cp/parsre.c (cp_parser_requires_expression): Gracefully
45         fail when parsing a requires expr outside a template.
47 2013-10-24  Andrew Sutton  <andrew.n.sutton@gmail.com>
48         * gcc/cp/c-common.c (c_common_r): Remove unused keywords "assume",
49         "axiom", and "forall".
50         * gcc/cp/c-common.h (rid): Removed unused reserved word ids.
52 2013-10-24  Edward Smith-Rowland  <3dw4rd@verizon.net>
53         * gcc/cp/typeck.c (cp_build_function_call_vec): Use unused variable 
54         loc.
56 2013-10-23  Andrew Sutton  <andrew.n.sutton@gmail.com>
57         * gcc/cp/class.c (get_member_fntemplate): New.
58         (are_constrained_member_overloads): Only get a template declaration
59         if the member function is, in fact, a template or temploid.
60         * gcc/cp/pt.c (check_explicit_specialization): Do not allow
61         explicit specializations to be declared 'concept', and do not allow
62         an explicit specialization of a concept.
63         * gcc/cp/decl.c (grokfndecl): Propagate the concept flag to
64         check_explicit_specialization.
66 2013-10-22  Andrew Sutton  <andrew.n.sutton@gmail.com>
67         * gcc/c-family/c-common.c (cxx_dialect): Make the default
68         language C++11.
69         * gcc/cp/constraint.cc (check_constrained_friend): Don't assert
70         on error_mark_node.
72 2013-10-16  Andrew Sutton  <andrew.n.sutton@gmail.com>
73         * gcc/cp/logic.cc (left_requires), (decompose_left): Add
74         decomposition rules for requires expressions.
75         (subsumes_requires), (subsumes_prop): Add subsumption rules for
76         requires expressions.
77         * gcc/cp/constraint.cc (diagnose_trait): Diagnose failed conversion
78         requirements.
80 2013-10-16  Andrew Sutton  <andrew.n.sutton@gmail.com>
81         * gcc/cp/constraint.cc (finish_concept_name): Allow functions with
82         the same name as concepts to resolve as call expressions in the
83         usual way.
85 2013-10-16  Andrew Sutton  <andrew.n.sutton@gmail.com>
86         * gcc/cp/constraint.cc (conjoin_requiremens): New.
87         (resolve_constraint_check): Filter non-concept candidates before
88         coercing arguments. Perform deduction in a template-decl processing
89         context to prevent errors during diagnosis.
90         (finish_concept_name), (finish_shorthand_requirement),
91         (get_shorthand_requirements): New.
92         * gcc/cp/pt.c (template_parm_to_arg): Make non-static.
93         (process_templat_parm): Build shorthand requirements from the
94         parameter description.
95         (end_templat_parm_list): New.
96         (convert_placeholder_argument): New.
97         (convert_template_argument): Match placeholder arguments against
98         any template parameter.
99         (tsubst_pack_conjuction):  New.
100         (tsubst_expr): Expand a pack as a conjunction.
101         (type_dependent_expression_p): Placeholders are always type
102         dependent.
103         * gcc/cp/parser.c (cp_is_constrained_parameter), 
104         (cp_finish_template_type_parm), (cp_finish_template_template_parm)
105         (cp_finish_non_type_template_parm), (cp_finish_constrined_parameter):
106         New.
107         (cp_parser_template_parameter): Handle constrained parameters.
108         (cp_parser_nonclass_name): An identifier naming an overload set
109         may declare a constrained parameter.
110         (cp_parser_type_parameter), (cp_parser_template_declaration_after_exp): 
111         Get shorthand requirements from the tmeplate parameter list.
112         * gcc/cp/cp-tree.h (TEMPLATE_PARM_CONSTRAINTS): New.
114 2013-10-07  Andrew Sutton  <andrew.n.sutton@gmail.com>
115         * gcc/cp/cp-tree.h (check_constrained_friend): Take requirements as
116         an argument.
117         * gcc/cp/constraints.cc (check_constrained_friend): Do not diagnose
118         errors in unconstrained friend declarations.
119         * gcc/cp/parser.cc (cp_parser_member_declaration): Pass current
120         requirements to check_constrained_friend.
122 2013-10-07  Andrew Sutton  <andrew.n.sutton@gmail.com>
123         * gcc/cp/parser.c (cp_parser_member_declaration): Check that
124         a constrained friend definition is valid.
125         * gcc/cp/decl.c (grokfndecl): Disallow constrained friend template
126         specializations.
127         * gcc/cp/constraints.cc (check_constrained_friend): New.
128         * gcc/cp/typeck.c (cp_build_function_call_vec): Diagnose constraints
129         in the presence of the failure of a single candidate.
130         * gcc/cp/cp-tree.h (check_constrained_friend): New.
131         * gcc/cp/call.c (is_non_template_member_fn): Make inline.
132         (is_non_template_friend), (is_constrainable_non_template_fn): New.
133         (add_function_candidate): Predicate check on
134         is_constrainable_non_template_fn.
136 2013-09-10  Andrew Sutton  <andrew.n.sutton@gmail.com>
137         * gcc/cp/cp-tree.h (TEMPLATE_PARMS_CONSTRAINTS): New.
138         * gcc/cp/parser.c (cp_parser_template_declaration_after_export),
139         (cp_parser_type_parameter): Use TEMPLATE_PARMS_CONSTRAINTS.
140         * gcc/cp/semantics.c (fixup_template_scope): Use 
141         TEMPLATE_PARMS_CONSTRAINTS.
143 2013-09-11  Andrew Sutton  <andrew.n.sutton@gmail.com>
144         * gcc/cp/cxx-pretty-print.c (pp_cxx_compound_requirement),
145         (pp_cxx_type_requirement), (pp_cxx_validtype_expr): Use 
146         pp->type_id() instead of pp_cxx_type_id().
148 2013-09-09  Andrew Sutton  <andrew.n.sutton@gmail.com>
149         * gcc/cp/pt.c (get_class_bindings): Pass the partial specialization
150         for constraint evaluation. Evaluate constraints, resulting in
151         deduction failure on error.
152         (get_specializaing_template_decl), (get_specialization_constraints),
153         (maybe_new_partial_specialization): New.
154         (maybe_process_partial_specialization): Allow the creation of
155         new types for constrained partial specializations.
156         (process_partial_specialization): Modify the canonical type
157         of constrained partial specializations.
158         (instantiate_class_template_1): Do not explicitly check constraints
159         during class template instantiation.
160         (tsubst_decl): Instantiate the constraints of template declarations.
161         (more_specialized_class): Pass specializations to get_class_bindings().
162         Compare specialization constraints if the types are equivalent.
163         (most_specialized_class): Pass specialization to get_class_bndings().
164         * gcc/cp/decl2.c (check_class_fn): Get the decl's requirements from
165         either the current template reqs or from the template parameters.
166         Allow overloading of constrained out-of-class member definitions.
167         * gcc/cp/semantics.c (fixup_template_type): New. Match the template
168         scope to a specialization with appropriate constraints.
169         (finish_template_type): Fix template type when entering scope.
170         * gcc/cp/parser.c (cp_parser_parse_type_parameter): Attach
171         requirements to the current template parameter list.
172         (cp_parser_init_declarator): Parse requires clauses for out-of-class
173         member definitions. Be sure to restore current constraints before
174         exiting the function.
175         (cp_parser_member_declarator): Restore the previous requirements in
176         an early-exit branch.
177         (cp_parser_late_parsing_for_member): Restore constraints after
178         maybe_end_member_template_processing().
179         (cp_parser_template_declaration_after_exp): Attach constraints to
180         the current template parameters.
181         * gcc/cp/constraint.cc (reduce_template_id): Don't crash when
182         omitting ()'s on constraint calls.
183         (check_requirements): Don't evaluate dependent arguments.
184         (check_constraints): Don't try to evaluate when arguments are
185         dependent.
186         (equivalent_constraints): Optimize the case when a and b are the
187         same constraints.
189 2013-07-26  Andrew Sutton  <andrew.n.sutton@gmail.com>
190         * gcc/cp/semantics.c (trait_expr_value): Evaluate __is_same_as.
191         (finish_trait_expr): Check __is_same_as and __is_convertible_to.
192         * gcc/cp/constraint.cc (diagnose_trait): Diagnose failures in
193         __is_same_as.
194         * gcc/cp/parser.c (cp_parser_primary_expression), 
195         (cp_parser_trait_expr): Parse __is_same_as.
196         * gcc/cp/cp-tree.h (cp_trait_kind): Add CPTK_IS_SAME_AS.
197         * gcc/cp/cxx-pretty-print.c (pp_cxx_trait_expression): Pretty print
198         __is_same_as trait.
200 2013-07-26  Andrew Sutton  <andrew.n.sutton@gmail.com>
201         * gcc/cp/tree.c (cp_walk_subtrees): Don't recurse through the
202         requires expr parameter list.
204 2013-07-25  Andrew Sutton  <andrew.n.sutton@gmail.com>
205         * gcc/cp/parser.c (cp_parser_requires_expr): Update parser using new
206         requires expression nodes. Renamed some grammar productions to better 
207         reflect the representation of the syntax. Create a new scope for 
208         requires parameters.
209         (cp_parser_nested_requirement): Wrap results in a NESTED_REQ node.        
210         * gcc/cp/semantics.c (xvalue_result_type): New.
211         (trait_expr_value): Evaluate __is_convertible_to.
212         (finish_requires_expr): Implemented, along with other functions to
213         construct and evaluate nodes for template constraints.
214         (potential_constant_expression_1): Handle requires expressions.
215         (finish_template_requirements), (finish_requires_expr), etc:
216         Move to constraint.cc.
217         * gcc/cp/cp-tree.def: (REQUIRES_EXPR), (EXPR_REQ), (TYPE_REQ),
218         (NESTED_REQ), (VALIDEXPR_EXPR), (VALIDTYPE_EXPR), (CONSTEXPR_EXPR):
219         New.
220         * gcc/cp/cp-objcp-common.c (cp_common_init_ts): Make new nodes typed.
221         * gcc/cp/cp-tree.h (finish_expr_requirement), 
222         (finish_type_requirement), (finish_nested_requirement),
223         (finish_validexpr_expr), (finish_validtype_expr),
224         (finish_constexpr_expr): New.
225         * gcc/cp/pt.c (convert_nontype_argument): Use can_convert_standard.
226         (retrieve_local_specialization), (register_local_specialization),
227         (extract_fnparm_pack): Make non-static.
228         (tsubst_expr): Substitution rules for requires expressions.
229         (instantiate_requirements): Move to constraints.cc
230         (tsubst_constraint): Remove.
231         * gcc/cp/call.c (can_convert): Allow user-defined conversions.
232         (can_convert_standard): New.
233         * gcc/cp/cvt.c (convert_to_reference): Use can_convert_standard.
234         * gcc/cp/search.c (check_final_overrider): Use can_cnvert_standard.
235         * gcc/cp/typeck.c (build_static_cast_1): Use can_convert_standard.
236         * gcc/cp/error.c (dump_expr): Pretty print new nodes.
237         * gcc/cp/cxx-pretty-print.c (pp_cxx_primary_expression): Pretty
238         print new expr/req nodes.
239         (pp_cxx_requires_expr): New along with related functions for
240         pretty printing requirements.
241         (pp_cxx_parameter_declaration_clause): Accommodate "raw" parameter
242         lists in addition to function decls.
243         (pp_cxx_requirement_parameter_list): Unified with parameter decl clause.
244         * gcc/cp/cxx-pretty-print.h (pp_cxx_requires_expr): New along with
245         related functions for pretty printing requirements.     
246         * gcc/cp/logic.cc: Move header comments to top of file.
247         * gcc/cp/constraint.cc (reduce_requirements): Handle requires
248         expressions.
249         (diagnose_constraints): Rename and handle requires expressions.
251 2013-07-01  Andrew Sutton  <andrew.n.sutton@gmail.com>
252         * gcc/cp/error.c (cp_printer): Fix unnecessary whitespace change.
253         * gcc/cp/constraint.cc (diagnose_node): Don't fail diagnosing
254         disjunctions.
256 2013-07-01  Andrew Sutton  <andrew.n.sutton@gmail.com>
257         * gcc/cp/class.c (are_constrained_member_overloads): Fix doc typos.
259 2013-06-24  Andrew Sutton  <andrew.n.sutton@gmail.com>
260         * gcc/cp/parser.c (cp_parser_init_declarator): Parse template
261         requirements for out-of-class member definitions.
262         * gcc/cp/decl2.c (check_classfn): Include match out-of-class
263         definitions using constraints.
264         * gcc/cp/constraint.cc (equivalently_constrained). Use get_constraints.
265         (more_constrained). Use get_constraints. 
267 2013-06-24  Andrew Sutton  <andrew.n.sutton@gmail.com>
268         * gcc/cp/cp-tree.h (tree_template_info). Remove constraint from 
269         template info.
270         (check_template_info): Removed (unused).
271         (TI_CONSTRAINT): Removed (no longer needed) along with related macros.
272         (DECL_CONSTRAINTS): New. Get constraints from DECL_SIZE_UNIT for 
273         template decls.
274         (build_template_info): Removed overload taking constraints.
275         (get_constraints): Removed (no longer needed).
276         * gcc/cp/class.c (are_constrained_member_overlaods): Allow constrained 
277         member function templates to be differentiated as overloads.
278         * gcc/cp/decl.c (decls_match): Only compare constraints on 
279         declarations.
280         (grokfndecl): Don't pass constraints to build_template_info.
281         * gcc/cp/tree.c (bind_template_template_parm): Don't pass constraints 
282         to build_template_info.
283         * gcc/cp/pt.c (build_template_info): Removed overload taking 
284         constraints.
285         (check_explicit_specialization): Don't build new constraints for 
286         template info.
287         (build_template_decl): Pass constraints. Update docs.
288         (process_partial_specialization): Stub out support for constrained
289         partial specialiations.
290         (push_template_decl_real): Build template decls with current template 
291         reqs. Don't pass constraints to build_template_info.
292         (add_inherited_template_parms): Build new constraints from inherited
293         template constructors.
294         (redeclare_class_template): Update to new constraint interface.
295         (is_compatible_template_arg): Update to new constraint interface.
296         (lookup_template_class_1): Don't build new constraints or pass them to
297         build_template_info.
298         (instantiate_class_template_1): Update to new constraints interface.
299         (tsubst_decl): Don't build new constraints or pass them to
300         build_template_info. For function templates, explicitly instantiate
301         new constraints for member functions of class templates.
302         * gcc/cp/semantics.c: Associate constraints with template template 
303         parms directly, not through template info.
304         * gcc/cp/constraint.cc (get_constraints): Simplified to use new constraints
305         interface.
306         (check_constraints): Update to use new constraints interface.
307         (equivalently_constrained): Update to use new constraints interface.
308         (more_constrained): Update to use new constraints interface.
309         * gcc/cp/parser.cpp (cp_parser_late_parsing_for_member): Update to use 
310         new constraints interface.
311         * gcc/cp/call.c (is_non_template_member_fn): New.
312         (add_function_candidate): Only check constraints for non-template member
313         functions.
315 2013-06-21  Andrew Sutton  <andrew.n.sutton@gmail.com>
316         * gcc/cp/parser.c (cp_parser_requires_clause): Pulled out of
317         cp_parser_requires_clause_opt for reuse in the requires expr parser.
318         (cp_parser_requires_expression): New, along with a family of
319         sub-expression parsers for the new feature.
320         * gcc/cp/semantics.c (finish_requires_expr): Stub.
321         (finish_syntax_requirement): Stub.
322         (finish_type_requirement): Stub.
323         (finish_constexpr_requirement): Stub.
324         (finish_noexcept_requirement): Stub.
325         (finish_requires_expr): Stub.
326         * gcc/cp/cp-tree.h: (finish_requires_expr): New.
327         (finish_syntax_requirement): New.
328         (finsih_type_requirement): New.
329         (finish_constexpr_requirement): New.
330         (finish_noexcept_requirement): New.
332 2013-06-21  Andrew Sutton  <andrew.n.sutton@gmail.com>
333         * gcc/cp/error.c (subst_to_string): Allow this to be called explicitly
334         passing template parameters in the TREE_TYPE and with a null 
335         TREE_PURPOSE.
336         * constraint.cc (check_requirements): New overload taking template
337         arguments.
338         (check_constraints.cc): Move instantiation and checking into the
339         new check_requirements overload.
340         (diagnose_requirements): New family of functions for diagnosing 
341         constraint failures.
343 2013-06-18  Andrew Sutton  <andrew.n.sutton@gmail.com>
344         * gcc/cp/class.c (are_constrained_member_overloads): New.
345         (add_method): Allow overloading of constrained member functions.
346         * gcc/cp/call.c (rejection_reason_code): New rr_constraint_failure.
347         (template_constraint_failure): New.
348         (add_function_candidate): Check for viability as a precondition to use.
349         (add_template_candidate_real): Integrate constraint diagnostics.
350         Provide constraint info for new template instantiations.
351         (print_z_candidate): Emit diagnostics for constraint failures.
352         (template_decl_for_candidate): New.
353         (joust): Allow non-member templates of class templates to be evaluated
354         in more_specialized_fn if they are constrained.
355         * gcc/cp/ptree.c (cxx_print_xnode): Dump constraint info.
356         * gcc/cp/semantics.c (finish_template_template_parm): Build template
357         info for template template parameters.
358         (is_unary_trait): New.
359         (is_binary_trait): New.
360         (finish_trait_expr): Check for binary traits using new function.
361         * gcc/cp/constraint.cc (join_requirements): New
362         (conjoin_requirements): Join expressions correctly. Fixed docs.
363         (disjoin_requirements): Removed.
364         (is_constriant): Removed.
365         (resolve_constraint_check): New. Replaces previous get_constraint
366         check and related functions.
367         (get_constraints): New, along with helper functions.
368         (suppress_template_processing): New. 
369         (check_template_constraints): New, along with helper functions.
370         (equivalent_constraints): New.
371         (equivalently_constrained): New.
372         (more_constraints): New.
373         (more_constrianed): New.
374         (diagnose_constraint_failure): New.
375         * gcc/cp/decl.c (decls_match): Check for constraint equivalence if
376         the types are the same.
377         (check_concept_refinement): New.
378         (are_constrained_overloads): New.
379         (duplicate_decls): Handle constraints for ambigous declarations. Check
380         and diagnose concept refinement.
381         (check_concept_fn): Don't fail completely just because the concept
382         isn't defined correctly. Allow analysis to continue as if declared
383         constexpr. Concepts must return bool.
384         * gcc/cp/tree.c (bind_template_template_parm): Provide empty 
385         constraints for bound template template parameters.
386         * gcc/cp/logic.cc: Rewrite of proof state and related structures and
387         decomposition logic. Removed right-decomposition logic, but retained
388         right-logical rules.
389         (match_terms): Renamed from entails.
390         (subsumes_prop): Cleanup, added specific handlers for and/or cases.
391         (subsumes_constraints): Update from interface change.
392         * gcc/cp/cp-tree.h (check_constraint_info): Renamed and applied
393         interface change.
394         (check_template_info): Renamed and applied interface change.
395         (cp_unevaluated): New
396         (local_specialization_stack): New.
397         (coerce_template_parms): New.
398         (is_unary_trait): New.
399         (is_binary_trait): New.
400         (get_constraints): New.
401         (check_constraints): New.
402         (check_template_constraints): New.
403         (subst_template_constraints): New.
404         (equivalent_constraints): New.
405         (equivalently_constrained): New.
406         (more_constraints): New.
407         (more_constrained): New.
408         (diagnose_constraints_failure): New.
409         * gcc/cp/cxx-pretty-print.c (pp_cxx_template_declaration): Print the
410         template requirements.
411         * gcc/cp/pt.c (local_specialization_stack): New.
412         (build_template_info): Refactor into 3-argument version and 
413         incorporate template requirements.
414         (check_explicit_specialization): Instantiate requirements for
415         template info.
416         (push_template_decl_real): Include constraints in template info.
417         (redeclare_class_template): Diagnose redeclaration with different
418         constraints.
419         (is_compatible_template_arg): New.
420         (convert_template_argument): Check constraints on template template
421         arguments and diagnose errors.
422         (lookup_template_class_1): Check constraints on alias templates.
423         Keep constraints with instantiated types.
424         (instantiate_class_template_1): Check constraints on class templates.
425         (tsubst_decl): Instantiate and keep constraints with template info.
426         Also, allow dependent pack arguments to produce neww parameter
427         packs when instantiated.
428         (coerce_template_parms): New overload.
429         (tsubst_copy): Handle REAL_TYPE and BOOLEAN_TYPE.
430         (tsubst_copy_and_build): PARM_DECLs can be instantiated as pack
431         expansions (used with requires expression).
432         (fn_type_unification): Check constraints for function templates.
433         (more_specialized_fn): Determine which candidate is more constrained.
434         (substitute_template_parameters): Removed.
435         (tsubst_constraint): New.
436         (substitute_requirements): New.
437         * gcc/cp/parser.c: (cp_parser_optional) Removed along with helper
438         functions, etc.
439         (cp_unevaluated): New.
440         (cp_parser_type_parameter): Check for requires kw explicitly, and
441         save/clear template requirements before parsing the requires clause.
442         (cp_parser_requires_clause): Removed.
443         (cp_parser_template_declaration_after_exp): Check for requires kw
444         explicitly.
445         * gcc/system.h (cstdlib): Removed include.
446         * gcc/c-family/c-common.h (D_CXX_CONCEPTS): New flag for disabling
447         concept keywords.
448         * gcc/c-family/c.opt (flag_concepts): Remove redundant declaration.
449         * gcc/c-family/c-common.c (c_common_r): Concept-specific keywords
450         are only enabled when concepts are enabled.
452 2013-06-01  Andrew Sutton  <andrew.n.sutton@gmail.com>
453         * gcc/system.h (cstdlib): Include <cstdlib> to avoid poisoned
454         declaration errors.
455         * gcc/c-family/common.c (c_common_r): Added __is_same_as intrinsic,
456         removed previous, unused intrinsics.
457         * gcc/c-family/common.h (rid): Added RID_IS_SAME_AS.
458         * gcc/cp/parser.c (take): New.
459         (cp_requires_clause): New.
460         (cp_requires_clause_opt): New.
461         (cp_rule): New.
462         (cp_parser_optional_if_token): New.
463         (cp_parser_optional_if_not_token): New.
464         (cp_parser_optional_if_keyword): New.
465         (cp_parser_decl_specifier_seq): Parse 'concept' as a declspec.
466         (cp_parser_type_parameter): Parse constrained template template parms.
467         (cp_parser_member_specification_opt): Parse member constraints after
468         the declaration, not before.
469         (cp_parser_template_declaration_after_exp): Rewrote parsing for
470         template requirements
471         (cp_parser_late_parsing_for_member): Re-push the current template 
472         requirements when late-parsing member definitions.
473         * gcc/cp/decl.c (check_concept_fn): New.
474         (grokfndecl): Semantics for concept declspec.
475         (grokdeclarator): Semantics for concept declspec.
476         (xref_tag_1): Update to new interface.
477         * gcc/cp/constraint.cc (make_constraints): New.
478         * gcc/cp/cp-objcp-common.c (cp_tree_size): Add case for constraint_info.
479         * gcc/cp/cp-tree.h (require): New.
480         (tree_template_info): Add a field for constraint info.
481         (tree_constraint_info): New.
482         (constraint_info_p): New.
483         (template_info_p): New.
484         (CI_SPELLING): New.
485         (CI_REQUIREMENTS): New.
486         (CI_ASSUMPTIONS): New.
487         (TI_CONSTRAINT): New.
488         (TI_SPELLING): New.
489         (TI_REQUIREMENTS): New.
490         (TI_ASSUMPTIONS): New.
491         (DECL_TEMPLATE_CONSTRAINT): New.
492         (CLASSTYPE_TEMPLATE_CONSTRAINT): New.
493         (ENUM_TEMPLATE_CONSTRAINT): New.
494         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_CONSTRAINT): New.
495         (TYPE_TEMPLATE_CONSTRAINT): New.
496         (cp_tree_node_structure_enum): Added entry for constraint info.
497         (lang_tree_node): Added entry for constraint info.
498         (lang_decl_base): Added bit for concept declarations.
499         (DECL_DECLARED_CONCEPT_P): New.
500         (cp_decl_spec): Added ds_concept declaration specifier.
501         * gcc/cp/Make-lang.in (logic.o): New target.
502         * gcc/cp/semantics.c (finish_template_requirements): Rewrite.
503         * gcc/cp/logic.cc: New
504         * gcc/cp-tree.def (CONSTRAINT_INFO): New node.
505         * gcc/cp/pt.c (current_template_args): Make non-static.
506         (redeclare_class_template): Take constraints as a 3rd argument
508 2013-04-01  Andrew Sutton  <andrew.n.sutton@gmail.com>
509         
510         * gcc/cp/Make-lang.in: Add constraints.o target.
511         * gcc/cp/cp-tree.h (substitute_template_parameters): Declare.
512         (instantiate_requirements): Declare.
513         (conjoin_requirements): Declare.
514         (disjoin_requirements): Declare.
515         (reduce_requirements): Declare.
516         * gcc/cp/pt.c (substitute_template_parameters): Define.
517         (instantiate_requirements): Define.
518         * gcc/cp/pt.c (finish_template_requirements): Call
519         reduce_requirements to get constraints.
520         * gcc/cp/parser.c (cp_parser_type_parameter): Restore saved
521         constraints after parsing template template parameter decl.
522         * gcc/cp/constraints.cc: New.
524 2013-03-11  Andrew Sutton  <andrew.n.sutton@gmail.com>
525         * gcc/cp/Make-lang.in: Add constraint.c
526         * gcc/cp/constraint.c: New
527         (conjoin_requirements): New
528         (disjoin_requirements): New
529         (requirement_reduction): New class
530         (reduce_requirements): New
531         * gcc/cp/cp-tree.h (reduce_requrements): New
532         (conjoin_requirements): New
533         (disjoin_requirements): New
534         * gcc/cp/cp-tree.h (finish_template_template_parm) Comments.
535         * gcc/cp/semantics.c (finish_template_requirements) Start
536         working with requirements.
539 2013-03-01  Andrew Sutton  <andrew.n.sutton@gmail.com>
541         * gcc/cp/cp-tree.h (saved_scope): Add template requirements.
542         (finish_template_requirements): Declare
543         * gcc/cp/parser.c (cp_parser_template_requirement_opt): Declare.
544         (cp_parser_template_declaration): Document grammar extensions.
545         (cp_parser_type_parameter): Parse requirements for template
546         template parameters.
547         (cp_parser_member_declaration): Parse requirements for
548         members of class templates.
549         (cp_parser_template_requirement_opt): Define.
550         (cp_parser_template_declaration_after_exp): Parse requirements
551         for template declarations.
552         * gcc/cp/semantics.c (finish_template_requirements): Define.
553         * gcc/cp/lex.c (cxx_init): Enable concepts by default.
555 2013-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
557         * lex.c (flag_concepts): Revert left over declaration.
559 2013-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
561         * gcc/c-family/c-common.c (cxx_dialect): Set C++11 as default.
562         * gcc/c-family/c.opt(flag_concepts): Add.
563         * gcc/cp/lex.c (flag_concepts): New.  Enabled concept support by
564         default.
566 2013-02-28  Andrew Sutton  <andrew.n.sutton@gmail.com>
568         * gcc/c-family/c-common.h (rid): New resreserved words for concepts.
569         * gcc/c-family/c-common.c (c_common_reswords): Definitions thereof.
570         * gcc/doc/extend.texi (write_symbol): Initial concept docs.