This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>
> 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 discipline, and
there's a bunch of dead/legacy code that I need to clean up. And of course
some regressions. I wanted to spend the weekend on this and forward a
cleaner version next week. But no time is as good as the present it seems.

This fork reimplements concepts as currently specified in the WD (for the
most part). It also preserves TS syntax (but not behavior), although there
are certainly going to be some new bugs.

-std=c++2a turns on concepts by default (sets -fconcepts)
-fconcepts-ts can be additionally specified to enable TS extensions
(abbreviated fn templates, etc).
-fconcepts on its own gives you (should give you) TS syntax with C++20
semantics and no C++20 features.

Here's what's changed:
- new requires clause syntax as required in the WD (-fconcepts-ts will
change this back to the TS syntax)
- concept bool is now a warning, although (IIRC) disabled with
-fconcepts-ts. Function and variable concepts live on.
- concepts are now their own kind of declaration (CONCEPT_DECL). That was a
big change.
- now only 3 kinds of constraints: conj, disj, and pred (should be
atomic, also needs a dead code cleanup).
- constraints on declarations are represented as expressions -- no
normalization until later
- associated constraints are only instantiated when checked -- no premature
substitution
- new implementaiton of satisfaction, does not require ahead-of-time
normalization
- new implementation of normalization (fewer nodes, smaller impl)
- atomic constraint comparison based on expr identity/parameter mapping
- complete rewrite of subsumption (new comparison model invalidated some
assumptions in the old impl)
- constrained decls differentiated by syntax of constraints (not
equivalence)
- moved the concepts testsuite into c++2a directory as a vetting/curating
process, new 2a tests, new ts-compatability tests

There are some bugs and regressions. I know for a fact that we've broken
partial specialization of variable templats, but I'm really not sure how.
There's also probably a bug in the constraint comparison implementation
that affects partial ordering. More testing is needed. I mostly ignored the
TS support while updating to the WD semantics, so that's been a little
buggy when I brought it back online. Also, sometimes diagnostics aren't
emitted correctly.

I'm not quite sure how to proceed with submitting this patch. Once I made
the decision to make concepts their own kind of declaration, the idea of
sending small patches went right out the window.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]