[c++-concepts] constrained friends

2014-08-21 Thread Andrew Sutton
Added tests for constrained friends. No code, we already to the right thing. 2014-08-15 Andrew Sutton Add tests for constrained friends. * gcc/testsuite/g++.dg/concepts/friend1.C: New. * gcc/testsuite/g++.dg/concepts/friend2.C: New. Andrew Index: gcc/testsuite/g++.dg/concepts/friend2

Re: [c++-concepts] constrained friends redux

2013-10-04 Thread Paolo Carlini
Hi Andrew, On 10/04/2013 07:36 PM, Andrew Sutton wrote: + if (!check_template_constraints (tmpl, args)) +{ + location_t loc = DECL_SOURCE_LOCATION (function); + error ("%qD is not a viable candidate", function); + diagnose_constraints (

Re: [c++-concepts] constrained friends redux

2013-10-04 Thread Jason Merrill
OK. Jason

Re: [c++-concepts] constrained friends redux

2013-10-04 Thread Andrew Sutton
>>> >Perhaps you mean that it must match a fully-instantiated function, so >>> > any >>> >constraints on the templates were considered during >>> >determine_specialization. > > >> This seems like a simple comment fix, but there's a longer explanation >> of what I want (see below). Would this be mor

Re: [c++-concepts] constrained friends redux

2013-10-04 Thread Jason Merrill
On 10/04/2013 09:20 AM, Andrew Sutton wrote: >Perhaps you mean that it must match a fully-instantiated function, so any >constraints on the templates were considered during >determine_specialization. This seems like a simple comment fix, but there's a longer explanation of what I want (see bel

Re: [c++-concepts] constrained friends redux

2013-10-04 Thread Andrew Sutton
>> + // Do not permit the declaration of constrained friend >> + // function declarations. They cannot be instantiated since >> + // the resulting declaration would never match the definition, >> + // which must be a non-template and cannot be constrained. > > >

Re: [c++-concepts] constrained friends redux

2013-10-02 Thread Jason Merrill
On 10/02/2013 09:05 AM, Andrew Sutton wrote: + // Do not permit the declaration of constrained friend + // function declarations. They cannot be instantiated since + // the resulting declaration would never match the definition, + // which must be a non-templat

[c++-concepts] constrained friends redux

2013-10-02 Thread Andrew Sutton
This patch implements constrained friends and disallows declarations of constrained friend template specialization. There was a previous question about whether I was doing the right thing in determine_specialization. I'm looking at that issue separately. 2013-10-01 Andrew Sutton * gcc/

Re: [c++-concepts] Constrained friends

2013-09-21 Thread Jason Merrill
On 09/21/2013 08:52 AM, Andrew Sutton wrote: It is wrong, but not for the reasons I gave. This only happens when you try to constrain a friend function that declares a specialization, which happens to be completely separate from the previously declared template. I'm going to disallow the abili

Re: [c++-concepts] Constrained friends

2013-09-21 Thread Andrew Sutton
I'm going to rewrite this patch tomorrow morning. The semantics aren't quite right --- they should be simpler. >> Previously, if constraints were not >> satisfied, we would not record the template as a candidate. However, >> this causes errors in class template instantiation if there are >> constr

Re: [c++-concepts] Constrained friends

2013-09-21 Thread Jason Merrill
On 09/13/2013 12:21 PM, Andrew Sutton wrote: Previously, if constraints were not satisfied, we would not record the template as a candidate. However, this causes errors in class template instantiation if there are constrained friend declarations whose constraints are not satisfied ("no matching t

[c++-concepts] Constrained friends

2013-09-13 Thread Andrew Sutton
This patch implements semantics for constrained friend templates and classes. The only significant changes are in determine_specializaiton and check_constrained_friend. Unless a friend function is defined, a constraints on friend declarations are never actually checked. The checking happens during