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