[PATCH] Diagnose hard errors during constraint satisfaction

2019-11-13 Thread Andrew Sutton
patch also fixes the crash PR92439, which was caused by not building the normalization tree in satisfy_constraint_expression. However, there are some other problems with that example that cause it to not compile (e.g., non-boolean atomic constraints). Andrew Sutton 0001-Diagnose-certain-constraint

[PATCH] PR c++/92403

2019-11-13 Thread Andrew Sutton
with a concept (either before or after the patch), you get false. So, this seems like the right behavior. Andrew Sutton 0001-Suppress-diagnostics-substituting-into-a-requires-ex.patch Description: Binary data

[c++-concepts] Class template constraints

2013-09-03 Thread Andrew Sutton
Attached is a patch for constrained class templates. It's the 3rd time I've sent it. I added some fixes for bugs discovered after the previous send, and added support for matching constrained declarations in out-of-class member function definitions. 2013-08-02 Andrew Sutton

Re: [c++-concepts] Class template constraints

2013-09-04 Thread Andrew Sutton
sing_template_decl; n > depth && parms; --n) >> +parms = TREE_CHAIN (parms); > > > If you're going to use this function from lookup_template_class_1, it can't > use current_template_*, since those are parser state which might be > something completely unrelated when we get here during instantiation. I was worried about that. I'm not sure how this gets invoked during instantiation. I'll look at it. -- Andrew Sutton andrew.n.sut...@gmail.com

Re: [c++-concepts] Class template constraints

2013-09-04 Thread Andrew Sutton
>> It's not supposed to be different. Checking constraints in >> instantiate_template is actually too late. We want to check before >> instantiation, at the point of use. > > Right, what I was getting at is that instantiate_template actually only > instantiates the declaration of a function, not th

Re: [c++-concepts] Class template constraints

2013-09-06 Thread Andrew Sutton
ndrew Sutton On Wed, Sep 4, 2013 at 3:49 PM, Jason Merrill wrote: > On 09/04/2013 01:33 PM, Andrew Sutton wrote: >> >> Ah. The goal is to check after we've deduced/coerced template >> arguments into a valid substitution. With functions, that's in >>

Re: [c++-concepts] Class template constraints

2013-09-09 Thread Andrew Sutton
Ok to commit? Attached is the doc fix patch. I'll send the TREE_TYPE patch shortly. Andrew Andrew Sutton On Sat, Sep 7, 2013 at 1:00 PM, Jason Merrill wrote: > On 09/06/2013 12:03 PM, Andrew Sutton wrote: >> >> +// Returns the template type of the class scope bei

[c++-concepts] pretty print fix

2013-09-09 Thread Andrew Sutton
The last merge didn't compile for me. Apparently some pretty printing functions have disappeared that were being called in the concept stuff. This patch just replaces the broken calls to pp_cxx_type_id with pp->type_id. Ok to commit? Andrew Sutton fix.patch Description: Binary data

[c++-concepts] template parameter constraints

2013-09-10 Thread Andrew Sutton
I added a new macro to replace the use of TREE_TYPE to get constraints. It's called TEMPLATE_PARMS_CONSTRAINTS. Patch attached: 2013-09-10 Andrew Sutton * gcc/cp/cp-tree.h (TEMPLATE_PARMS_CONSTRAINTS): New. * gcc/cp/parser.c (cp_parser_template_declaration_after_e

Re: [c++-concepts] template parameter constraints

2013-09-10 Thread Andrew Sutton
Will amend and commit tomorrow morning! Andrew Andrew Sutton On Tue, Sep 10, 2013 at 7:54 PM, Gabriel Dos Reis wrote: > Andrew Sutton writes: > > | I added a new macro to replace the use of TREE_TYPE to get > | constraints. It's called TEMPLATE_PARMS_CONSTRAINTS. Patch attac

[c++-concepts] Constrained friends

2013-09-13 Thread Andrew Sutton
he best template for the specialization. And then we only check the constraints if the declaration is a non-friend. 2013-09-13 Andrew Sutton * gcc/cp/cp-tree.h (check_constrained_friend): New. * gcc/cp/pt.c (determine_specialization): Only check constraints after determinin

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

[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

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-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

[c++-concepts] friends regression

2013-10-07 Thread Andrew Sutton
The last patch introduced a regression. This ensures that we don't generate false positives diagnosing errors in non-template contexts. 2013-10-07 Andrew Sutton * gcc/cp/cp-tree.h (check_constrained_friend): Take requirements as an argument. * gcc/cp/constrain

Re: [c++-concepts] friends regression

2013-10-08 Thread Andrew Sutton
No, any current_template_reqs are reset (set to null) before parsing any trailing requirements and restored after the fact. Andrew Sutton On Mon, Oct 7, 2013 at 3:05 PM, Jason Merrill wrote: > OK. > > If we have a friend declaration inside a constrained partial specialization, &g

[c++-concepts] Shorthand notation

2013-10-16 Thread Andrew Sutton
he current implementation is a bit hacky, and I'm wondering if I should introduce a new node for a pack conjunction. Change log follows. 2013-10-16 Andrew Sutton * gcc/cp/constraint.cc (conjoin_requiremens): New. (resolve_constraint_check): Filter non-concept candidates bef

Re: [c++-concepts] Shorthand notation

2013-10-18 Thread Andrew Sutton
A small follow up change. This removes the "sorry" from concept name resolution. Committed in r203815. 2013-10-16 Andrew Sutton * gcc/cp/constraint.cc (finish_concept_name): Allow functions with the same name as concepts to resolve as call expressions in the

Re: [c++-concepts] Shorthand notation

2013-10-18 Thread Andrew Sutton
I know. When I started working on the project, Gaby asked that I keep all concept-related changes in the top-level Changelog.concepts with full paths for the file names. Andrew Sutton On Fri, Oct 18, 2013 at 8:53 AM, Paolo Carlini wrote: > Hi, > > > On 10/18/2013 02:23 PM, Andrew

[c++-concepts] Bugfix

2013-10-18 Thread Andrew Sutton
Fixing 2 issues. A test for __is_convertible_to was missing in diagnose_trait, and *somehow* the logic for determining constraint ordering w.r.t. requires expressions was missing. Committed in 203826. 2013-10-16 Andrew Sutton * gcc/cp/logic.cc (left_requires), (decompose_left): Add

[c++-concepts] bitfield reference bugfix

2013-10-22 Thread Andrew Sutton
cepts. Also prevent an ICE for invalid constrained friends. 2013-10-16 Andrew Sutton * gcc/c-family/c-common.c (cxx_dialect): Make the default language C++11. * gcc/cp/constraint.cc (check_constrained_friend): Don't assert on error_mark_node. Andrew b

Re: [c++-concepts] small tidbits to get it to build

2013-10-23 Thread Andrew Sutton
oncepts-related work, but which aren't included in Concepts Lite. I'll apply the typeck fix. Andrew Sutton On Tue, Oct 22, 2013 at 10:02 PM, Ed Smith-Rowland <3dw...@verizon.net> wrote: > I had to get past two small bugs to get c++-concepts to build. > Take a good look

[c++-concepts] Specialization of concepts

2013-10-23 Thread Andrew Sutton
This patch disallows the explicit specialization of concepts, as required by the specification. It also fixes an ICE when comparing overloads of non-template members. 2013-10-23 Andrew Sutton * gcc/cp/class.c (get_member_fntemplate): New. (are_constrained_member_overloads

Re: [c++-concepts] small tidbits to get it to build

2013-10-24 Thread Andrew Sutton
Hi Ed, I committed half of your patch (the unused variable part) in r204011 and removed the unused keywords as a resolution for the other half in r204012. Changelog/patch follow: 2013-10-24 Andrew Sutton * gcc/cp/c-common.c (c_common_r): Remove unused keywords "a

[c++-concepts] Requires expr in non-templte

2013-10-25 Thread Andrew Sutton
-25 Andrew Sutton * gcc/cp/parsre.c (cp_parser_requires_expression): Gracefully fail when parsing a requires expr outside a template. Andrew Sutton template-requires.patch Description: Binary data

[c++-concepts] Constrained scope bugfix

2013-10-30 Thread Andrew Sutton
template void S::f() { } // Should be an error The right solution seems to be to diagnose the error only when defining an out-of-class member by verifying that each template scope in the qualified name matches a declaration with the same constraints. 2013-10-30 Andrew Sutton * gcc/cp/s

[c++-concepts] Diagnostics patch

2013-10-30 Thread Andrew Sutton
. Allow static member functions to be concepts. Andrew Sutton Index: gcc/cp/decl.c === --- gcc/cp/decl.c (revision 204092) +++ gcc/cp/decl.c (working copy) @@ -9074,6 +9074,12 @@ if (name == NULL) name = decl_context

Re: C++ PATCH to implement fold-expressions

2015-09-17 Thread Andrew Sutton
Fantastic. I've wanted to get back to this, but since school started back up, I haven't had any time to look at it. Thanks! Andrew On Thu, Sep 17, 2015 at 2:04 PM, Jason Merrill wrote: > Back in January Andrew mostly implemented C++1z fold-expressions > (https://isocpp.org/files/papers/n4295.h

Re: C++ PATCH for non-type constrained-type-specifiers

2015-11-06 Thread Andrew Sutton
> I started looking at allowing non-type constrained-type-specifiers in auto > deduction and then realized that we didn't handle them in function > parameters either. Fixing that brought home to me the oddity of having a > type-specifier stand in for a non-type. Mind weighing in on that on the >

[PATCH] concepts cleanups and subsumption caching

2019-10-15 Thread Andrew Sutton
will prevent redundant and potentially costly comparisons of constraints. Tested on bootstrap and vs. cmcstl2. Andrew Sutton cleanup.patch Description: Binary data

[PATCH] diagnose hard errors in concept satisfaction

2019-10-15 Thread Andrew Sutton
don't build that information until we know we need to diagnose an error. This patch does not include that context. Andrew Sutton errors.patch Description: Binary data

[PATCH] fix constrained auto parsing issue

2019-10-17 Thread Andrew Sutton
This fixes a parsing bug with constrained placeholders uses as the first parameter of a constructor. Andrew Sutton 0001-Fix-a-bug-with-type-constraints-in-constructors.patch Description: Binary data

Re: [PATCH] fix constrained auto parsing issue

2019-10-21 Thread Andrew Sutton
In cp_parser_simple_type_specifier: if (!type && flag_concepts && decl_specs) { /* Try for a type-constraint with template arguments. We check decl_specs here to avoid trying this for a functional cast. */ ... It's subtle. Andrew Sutton On Mon, Oct 21,

[PATCH] PR c++/92078 Add access specifiers to specializations

2019-11-14 Thread Andrew Sutton
Fixes mentioned issue. Tested on bootstrap and cmcsstl2. gcc/cp/ * pt.c (maybe_new_partial_specialization): Apply access to newly created partial specializations. Update comment style. gcc/testsuite/ * g++.dg/cpp2a/concepts-pr92078.C: New. Andrew pr92078.patch Description: Binary data

[PATCH] Fixes PR c++/89913

2019-11-15 Thread Andrew Sutton
Avoid ICE when the alias is ill-formed. gcc/cp/ * pt.c (get_underlying_template): Exit loop if the original type of the alias is null. gcc/testsuite/ * g++.dg/cpp2a/pr89913.C: New test. Andrew Sutton 0001-Don-t-segfault-on-error-PR-c-89913.patch Description: Binary data

[PATCH] Prevent recursive satisfaction (PR c++/88395)

2019-11-18 Thread Andrew Sutton
This applies on top of the patch here: https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01034.html Wrap satisfaction with push/pop_tinst_level to force termination on recursion. Andrew Sutton 0001-Prevent-recursive-satisfaction-PR-c-88395.patch Description: Binary data

Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)

2019-11-18 Thread Andrew Sutton
t crash, but it doesn't diagnose also doesn't fail as a result of recursive instantiation. The recursive-sat2.C test is the same except that it instantiates foo with a class type. This seems like it might be related to ADL, but entirely certain. Andrew Sutton On Mon, Nov 18, 2019 at 10:1

[PATCH] PR c++/92236: Improve static assertions of concepts

2019-11-20 Thread Andrew Sutton
expression ā€˜* i’ is invalid 8 | *i; | ^~ Andrew Sutton 0001-Emit-detailed-diagnostics-for-static-assertion-failu.patch Description: Binary data

[PATCH] PR c++/92439: Improve diagnostics for ill-formed requires-clauses

2019-11-22 Thread Andrew Sutton
This does a much better job identifying when an expression in a requires-clause needs parentheses. Andrew Sutton 0001-PR-c-92439.patch Description: Binary data

Re: [PATCH] Prevent recursive satisfaction (PR c++/88395)

2019-11-27 Thread Andrew Sutton
> > + if (tmpl) > > + push_tinst_level (tmpl); > > Actually, why not pass 't' here? I thought it would matter if 't' was a non-template. Turns out it doesn't. Updated and committed.

[PATCH] PR C++/92739

2019-12-02 Thread Andrew Sutton
Find attached. gcc/cp/ * parser.c (cp_parser_constraint_requires_parens): Exclude attributes as postfix expressions. gcc/testsuite/ * g++.dg/concepts-pr92739.C: New test. Andrew Sutton 0001-Fix-PR-c-92739.patch Description: Binary data

Re: Patch for constexpr variable templates

2014-08-07 Thread Andrew Sutton
This patch prevents the initializer from being checked when it is dependent. It also sets the type of a dependent template-id referring to a variable template to be unknown, making such expressions type dependent. 2014-08-07 Andrew Sutton * pt.c (lookup_template_variable): Make the

Re: Patch for constexpr variable templates

2014-08-07 Thread Andrew Sutton
>> * decl.c (cp_finish_decl): Don't check the initializer if it is >> value-dependent. > > > Why is this needed? I thought that check_initializer was evaluating the constant expression, and was resulting in errors because a template-id referring to a variable template with a conc

[c++-concepts] constraints redux

2014-08-08 Thread Andrew Sutton
match the wording the specification. Basically, "requirements -> constraints". Updated all affected tests. 2014-08-08 Andrew Sutton * gcc/cp/logic.cc (subsumes_constraints_nonnull): Don't re-normalize constraints, it's already been done. * gcc/cp/cp-

[c++-concepts] substitution fixes

2014-08-11 Thread Andrew Sutton
type is not being resolved (because tsubst returns early when args == NULL_TREE). The second patch fixes a regression introduced by the first patch. 2014-08-11 Andrew Sutton * gcc/cp/pt.c (tsubst): Don't short circuit substitution into types when processing constr

Re: Patch for constexpr variable templates

2014-08-12 Thread Andrew Sutton
>> * pt.c (lookup_template_variable): Make the type unspecified if >> any template arguments are dependent. > > > This hunk is OK. Hi Jason, did you apply this hunk of the patch, or should I just resend this by itself? Andrew

Re: Patch for constexpr variable templates

2014-08-12 Thread Andrew Sutton
Oohh... I can commit to trunk? I can do it tomorrow morning. Andrew Sutton On Tue, Aug 12, 2014 at 4:59 PM, Jason Merrill wrote: > On 08/12/2014 04:21 PM, Andrew Sutton wrote: >>>> >>>> * pt.c (lookup_template_variable): Make the type unspecified >>

Re: [c++-concepts] variable concepts

2014-08-13 Thread Andrew Sutton
Committed. Andrew Sutton On Wed, Aug 13, 2014 at 3:24 AM, Braden Obrzut wrote: > This patch adds support for variable concepts. > > There is a known issue that prevents concept variables from having requires > expressions that have parameters. This issue is not within the sco

Re: Patch for constexpr variable templates

2014-08-13 Thread Andrew Sutton
>> Oohh... I can commit to trunk? > > Yes, you're on the write-after-approval list in MAINTAINERS. :) True, but it's my first commit to trunk :) Incidentally, that's committed now. Andrew

[c++-concepts] explicit instantiation and specialization

2014-08-13 Thread Andrew Sutton
* gcc/cp/decl.c (various) Cosmetic fixes. (adjust_fn_constraints): Rewrite so that class template constraints are not imposed on member function declarations. * gcc/testsuite/g++.dg/concepts: New tests. Andrew Sutton Index: gcc

Re: [c++-concepts] explicit instantiation and specialization

2014-08-13 Thread Andrew Sutton
Ah... sorry. Leftovers. I didn't have time to run a full bootstrap build before heading out for a few days. I'll try to get those out tomorrow afternoon-ish. Andrew On Wed, Aug 13, 2014 at 9:13 PM, Ed Smith-Rowland <3dw...@verizon.net> wrote: > I get build fail: > > ../../gcc_concepts/gcc/cp/cal

Re: [c++-concepts] explicit instantiation and specialization

2014-08-15 Thread Andrew Sutton
Just committed this patch, fixing the bootstrap. 2014-08-13 Andrew Sutton Fix regression in bootstrap. * gcc/cp/call.c (get_temploid): Removed. No longer called. (joust): Remove unused variable declarations. Andrew On Wed, Aug 13, 2014 at 9:50 PM, Andrew Sutton wrote: > Ah... so

[c++-concepts] 2 patches

2014-08-18 Thread Andrew Sutton
: 2014-08-13 Andrew Sutton * gcc/cp/class.c (resolve_address_of_overloaded_function): Check constraints. * gcc/cp/decl.c (grokfndecl): For now, disallow constrained non-template functions. * gcc/testsuite/g++.dg/concepts: New tests. 2014-08-13 Andrew Sutton

[c++-concepts] normalization checks

2014-08-19 Thread Andrew Sutton
This patch adds checks for user-defined logical operators during constraint normalization and ensures that all atomics can be converted to bool. 2014-08-14 Andrew Sutton Implement normalization checks. * gcc/cp/constraint.cc (normalize_expr): Delegate cast and atomic

[c++-concepts] variable concept fixes

2014-08-20 Thread Andrew Sutton
Add more diagnostics for variable concepts. Also fix a regression where non-template concepts variables were causing ICEs because they aren't being allocated via build_lang_decl. 2014-08-15 Andrew Sutton Additional declaration restrictions on variable concepts. * gcc/cp/d

Re: [c++-concepts] variable concept fixes

2014-08-20 Thread Andrew Sutton
> On 08/20/2014 08:56 PM, Andrew Sutton wrote: >> >> + return VAR_P (decl) >> + && DECL_LANG_SPECIFIC (decl) >> + && DECL_DECLARED_CONCEPT_P (decl); > > this is brittle from the formatting point of view. Please double check in &g

[c++-concepts] template scoping error

2014-08-20 Thread Andrew Sutton
Fixes a regression in lookup rules involving declarations with nested-name-specifiers. In particular, we don't actually want to execute these rules if we absolutely don't have to. 2014-08-15 Andrew Sutton Fixing regression in scoping rules for templates. * gcc/cp/s

Re: [c++-concepts] variable concept fixes

2014-08-21 Thread Andrew Sutton
Ah... thanks for the clarification. Fixed (and committed). Andrew On Thu, Aug 21, 2014 at 4:26 AM, Paolo Carlini wrote: > Hi Andrew, > > > On 08/20/2014 11:08 PM, Andrew Sutton wrote: >>> >>> On 08/20/2014 08:56 PM, Andrew Sutton wrote: &

[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

[c++-concepts] cleanup expressions

2014-10-13 Thread Andrew Sutton
Sometimes, cleanup_point_exprs are being added to concept definitions. This patch allows that to happen, but removes the cleanup point during normalization. 2014-10-13 Andrew Sutton Fix bug related to cleanup expressions in concept definitions. * gcc/cp/constraint.cc

Re: [c++-concepts] cleanup expressions

2014-10-13 Thread Andrew Sutton
And here's the patch: Andrew Sutton On Mon, Oct 13, 2014 at 3:33 PM, Andrew Sutton wrote: > Sometimes, cleanup_point_exprs are being added to concept definitions. > This patch allows that to happen, but removes the cleanup point during > normalization. > > 2014-

[c++-concepts] introduction syntax regression

2014-10-13 Thread Andrew Sutton
The original patch for concept introductions was not popping a deferred access check. This fixes that problem, although I'm not sure if we need to defer access checks at all. 2014-10-13 Andrew Sutton Fix regression related to concept introductions. * gcc/cp/constrai

[c++-concepts]

2014-10-20 Thread Andrew Sutton
Fixing issues reported by users. 2014-10-20 Andrew Sutton Fixing user-reported issues and regressions * gcc/cp/parser.c (cp_parser_template_declaration_after_exp): Only pop access checks on failed parsing. * gcc/cp/pt.cpp (type_dependent_expr_p): Always treat a

[c++-concepts] Terse notation

2014-06-11 Thread Andrew Sutton
compound requirements: {expr} -> const auto&; // unnamed result type must form a valid type {expr} -> C; // unnamed result type satisfies the concept C Semantics will come later. Changelog: 2014-06-11 Andrew Sutton * gcc/cp/cp-tree.h (build_constrained_parameter): R

terse notation diagnostics

2014-06-12 Thread Andrew Sutton
Adds additional checks and tests for ill-formed programs. 2014-06-12 Andrew Sutton * gcc/cp/parser.c (cp_check_type_concept): New. (cp_check_concept_name): Remove redundant condition from check. Diagnose misuse of non-type concepts in constrained type specifiers

partial-concept-ids

2014-06-12 Thread Andrew Sutton
Add support for partial concept ids. Mostly this just refactors the basic support for concept names to also allow a template and extra arguments. Also added the missing .exp file for the test suite. 2014-06-12 Andrew Sutton * gcc/cp/constraint.cc (deduce_constrained_parameter

Re: [c++-concepts] Fix assertion failure with cp_maybe_constrained_type_specifier

2014-06-24 Thread Andrew Sutton
Braden, Did you have a specific test case that causes this breakage? I have a feeling that if we're missing base-link nodes in one place, we'll miss them in others too. Andrew On Tue, Jun 17, 2014 at 4:54 AM, Braden Obrzut wrote: > cp_maybe_constrained_type_specifier asserted that the decl pas

Re: [c++-concepts] Fix assertion failure with cp_maybe_constrained_type_specifier

2014-06-24 Thread Andrew Sutton
Committed as r211935. I updated the patch to add a more appropriate comment and changelog entry. Andrew On Tue, Jun 24, 2014 at 8:07 AM, Ed Smith-Rowland <3dw...@verizon.net> wrote: > I saw this during bootstrap. I've verified that the patch works (I was > working on similar). > > Ed > Index: pa

[c++-concepts] small pretty printing fix

2014-06-24 Thread Andrew Sutton
This helps improve debug output. When pretty printing template args including a placeholder, show instead of a dump_expr error. 2014-06-24 Andrew Sutton * gcc/cp/error.C (dump_expr): Pretty print placeholder to improve debug output. Committed as r211942. Andrew Index: gcc/cp/error.c

[c++-concepts] member concepts

2014-06-24 Thread Andrew Sutton
Actually allow member concepts in using shorthand notation. 2014-06-24 Andrew Sutton * gcc/cp/parser.c (cp_maybe_constrained_type_specifier): Defer handling the BASELINK check until concept-resolution in order to allow member conceps. (cp_parser_nonclass_name

Re: [c++-concepts] Fix assertion failure with cp_maybe_constrained_type_specifier

2014-06-24 Thread Andrew Sutton
y concepts -- I don't think I'm touching the initializer code at all. Andrew Sutton On Tue, Jun 24, 2014 at 11:42 AM, Ed Smith-Rowland <3dw...@verizon.net> wrote: > I'm not sure the warning is correct in any case... > > In i386.h > > struct

Re: Re: [c++-concepts] Fix assertion failure with cp_maybe_constrained_type_specifier

2014-06-25 Thread Andrew Sutton
> I did a full 3-stage bootstrap which is the default these days. > I'll try --disable-bootstrap and see what happens. I just did a full bootstrap build and got the same errors. The errors are correct for C++11, which was enabled by default in this branch. IIRC, aggregate initialization requires t

[c++-concepts] constraint folding

2014-06-25 Thread Andrew Sutton
Updating constraint parsing to match changes to spec. Constraints must always left unfolded, even when non-dependent, until they are evaluated. 2014-06-25 Andrew Sutton * gcc/cp/parser.c (cp_parser_requires_clause): Don't fold expressions when parsing a requires-c

Re: [c++-concepts] Change constraint equivalence

2014-06-27 Thread Andrew Sutton
> Please drop gcc/ and gcc/testsuite/ prefixes (the former goes to > cp/ChangeLog, the latter to testsuite/ChangeLog). This is the format (and file) that Gaby requested when we started the project. We can certainly distribute the entries, but I don't know if its worthwhile right now. Andrew

[c++-concepts] constraint association

2014-06-28 Thread Andrew Sutton
also lays the framework for allowing constraints to be associated with any _*DECL node (templates, functions, variables, types, etc). Changelog below; committed as 212103. 2014-06-28 Andrew Sutton * gcc/cp/cp-tree.h (DECL_CONSTRAINTS): Remove this macro; use get_constraints

[c++-concepts] Compiler options/bootstrap

2014-06-28 Thread Andrew Sutton
w format specifier ("Z") to the cxxdiag flags. That warning was turning into an error in the bootstrap build. FYI: The bootstrap builds cleanly for me now. Committed in r212105. 2014-06-28 Andrew Sutton * gcc/c-family/c.opt (flag_concepts): Don't enable by default.

Re: [c++-concepts] code review

2015-05-01 Thread Andrew Sutton
> It looks like things are coming together pretty well. What's your feeling > about readiness to merge into the trunk? Is the branch down to no > regressions? They are coming together pretty well. We have one major unit test failure involving template introductions (Braden is working on it), one

Re: [c++-concepts] code review

2015-05-08 Thread Andrew Sutton
Today is the first day I've had to look at these comments. >>if (TEMPLATE_PARM_CONSTRAINTS (current_template_parms)) >> -TYPE_CANONICAL (type) = type; >> +SET_TYPE_STRUCTURAL_EQUALITY (type); > > > This seems like papering over an underlying issue. What was the testcase > that motiva

[c++-concepts] merge from trunk

2014-11-13 Thread Andrew Sutton
I just merged the concepts branch with trunk, after fighting with the testing framework for the past hour. There was a change to gcc/testsuite/lib/prune.exp yesterday that doesn't appear to be compatible with *something* in this branch. It broke the entire test suite, giving the errors below for

Re: Concepts code review

2014-11-16 Thread Andrew Sutton
>>> +// Bring the parameters of a function declaration back into >>> +// scope without entering the function body. The declarator >>> +// must be a function declarator. The caller is responsible >>> +// for calling finish_scope. >>> +void >>> +push_function_parms (cp_declarator *declarator) >> >> I

Re: Concepts code review

2014-11-12 Thread Andrew Sutton
>> + // The constraint info maintains information about constraints >> + // associated with the declaration. >> + tree constraint_info; > > > We talked back at the end of June about moving this into a separate > hashtable; I'm still reluctant to add another pointer to most declarations > when on

Re: Concepts code review

2014-11-12 Thread Andrew Sutton
>> Agreed. I'll probably start looking at this on Friday morning. > > > Note that end of stage 1 is Saturday, as I just realized today. So the > sooner the better. :) Ouch. Good thing my merge with trunk broke in unexpected ways this morning -- minimally, something in cgraph ended up missing a #

Re: [C++ Patch] PR 71140 ("[concepts] ill-formed nested-requirement lacking a semicolon not rejected")

2018-10-12 Thread Andrew Sutton
> > BTW, I would discourage you from messing much with the concepts code > at this point, as a major overhaul should be coming soon. > Major overhaul: https://github.com/asutton/gcc (branch is concepts; we're about 2 weeks back from trunk). Unfortunately, I we haven't been following GCC commit d

Re: [concepts] Update to match the working draft (and bit more)

2018-10-18 Thread Andrew Sutton
the qmail-send program at sourceware.org. >> I'm afraid I wasn't able to deliver your message to the following addresses. >> This is a permanent error; I've given up. Sorry it didn't work out. >> >> : >> ezmlm-reject: fatal: Sorry, I don't accept messages larger than 40 bytes (#5.2.3) > Andrew Sutton

Re: [C++ Patch] PR 71140 ("[concepts] ill-formed nested-requirement lacking a semicolon not rejected")

2018-10-31 Thread Andrew Sutton
Sorry for the slow reply. I've been stuck working on some other projects. > Can you say a bit about why that was better than continuing to use > VAR_DECL? > I wanted to make sure that we avoid normal VAR_DECL processing routines, so we don't e.g., slip into a function where we might try to gener

[PATCH] Add -std=c++2a

2017-07-20 Thread Andrew Sutton
. gcc/testsuite/ New test for -std=c++2a. * g++.dg/cpp2a/cplusplus.C: New. Andrew Sutton cxx2a.patch Description: Binary data

Re: [PATCH] Add -std=c++2a

2017-07-20 Thread Andrew Sutton
ation introducer (WD). I was going to submit a followup that emits a warning when both -std=c++2a and -fconcepts are both enabled and then disables -fconcepts. Andrew Sutton On Thu, Jul 20, 2017 at 1:04 PM, Markus Trippelsdorf wrote: > On 2017.07.20 at 09:33 -0400, Andrew Sutton wrote: >>

Re: [PATCH] Giant concepts patch

2016-07-10 Thread Andrew Sutton
s why Casey is added to the mailing. You're missing a const overload of operator* for basic_operator. Patch forthcoming. Changelogs below. 2016-07-10 Andrew Sutton * constraint.cc (tsubst_type_constr, tsubst_implicit_conversion_constr, tsubst_argument_deducti

Re: [PATCH] Giant concepts patch

2016-07-10 Thread Andrew Sutton
Ah sure. Jason has been vetting my post-Jacksonville concepts patch in the branch jason/concepts-rewrite. I just pulled this off the github GCC mirror this morning to look at an outstanding question. Resulted in the previous 2 patches. I tried building a fresh pull of your cmcstl2 and got an off-b

concept diagnostics

2015-08-18 Thread Andrew Sutton
This is not a proper patch. I'm missing the usual changelog and I'm still running the regression tests, but I wanted to get some opinions before committing more time to it. This patch extends the diagnostics for concepts to report precise failures when constraints are not satisfied. It currently r

Re: [c++-concepts]

2013-05-30 Thread Andrew Sutton
> * Check against cxx11 dialect, not cxx0x. Let's talk about this tomorrow. I'm not quite sure how to do this. > * Any particular reason to use classes with operator() for the > parseers and the combinators? GCC can inline indirect calls to > functions with internal linkage. That sh

Re: [c++-concepts]

2013-05-30 Thread Andrew Sutton
I'll clean it up and commit tomorrow morning. > Once you've committed the patch, let me know so I can synchronize with > trunk -- or is there another patch coming in this week? I'm hoping to get all of the function-related functionality sent off by tomorrow or Saturday. I found a showstopper in t

Re: [c++-concepts]

2013-05-30 Thread Andrew Sutton
sions in constexpr functions (using "concept" as a declaration specifier to impose additional restrictions). Variable templates fall easily into this same set of restrictions. Plus, no overloading. Andrew On Thu, May 30, 2013 at 3:34 PM, Jason Merrill wrote: > On 05/30/2013 03:17

Re: [c++-concepts]

2013-06-01 Thread Andrew Sutton
> * Check against cxx11 dialect, not cxx0x. This check is actually all over parser.c, the reason it shows up in the patch is that I reverted a previous change that affected some code that included it. I'd feel better leaving it in, since its a change that could affect some other part of the com

[c++-concepts] constraints

2013-06-01 Thread Andrew Sutton
This patch adds constraint checking and overloading for function templates, class templates, and alias templates. This patch isn't as big as it seems, it just touches the compiler in a lot of different places. 2013-06-01 Andrew Sutton * gcc/cp/call.c (rejection_reason_code)

Re: [c++-concepts] code review

2013-06-06 Thread Andrew Sutton
Hi Jason, Thanks for the comments. I just went ahead and fixed all the editorial issues. Comments and questions below: >> * gcc/system.h (cstdlib): Include to avoid poisoned >> declaration errors. > > Poisoned declarations of what? This seems redundant with the #include > just

Re: [c++-concepts] code review

2013-06-08 Thread Andrew Sutton
>> +C++ ObjC++ Var(flag_concepts, true) > > This line declares flag_concepts implicitly. Ah... I see. Fixed. >> That's the long and short of it. Gaby suggested writing constraints >> here so that, for any instantiation, you would have easy access to the >> constraints for that declaration. > > I

Re: [c++-concepts] code review

2013-06-11 Thread Andrew Sutton
>> I think I previously put constraint_info in lang_decl_min, right next >> to template_info no less. It was easy to manage there, and initialized >> as part of build_template_decl. But this obviously doesn't work for >> partial specializations unless they get template_decls. > > > Right. And we w

Re: [c++-concepts] code review

2013-06-11 Thread Andrew Sutton
>> After investigating, neither call_expr nor resolve_nondeduced_context >> do what I need. I need a resolution of a call expression that does not >> return overload sets, especially in the case where the initial call >> expression is already dependent. > > > Does this have to do with restrictions

  1   2   >