Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Support requires-clause in more places #10286

Closed
wants to merge 4 commits into from
Closed

Commits on Mar 27, 2022

  1. [C++] Support requires-clause in more places

    Previously a C++20 requires-clause was only supported on `function`
    declarations.  However, the C++ standard allows a require-clause on
    class/union templates, alias templates, and variable templates, and
    also allows a requires clause after each template parameter list, not
    just the final one.
    
    This moves the requiresClause to be a property of `ASTTemplateParams`
    rather than `ASTDeclaration` to better match the C++ grammar and
    allows requires clauses in many places that are supported by C++20 but
    were not previously allowed by Sphinx, namely:
    
    - On class templates, alias templates, and variable templates
    
    - After each template parameter list, not just the last one.
    
    - After the template parameter list in template template parameters.
    
    When encoding the id, the requires clause of the last template
    parameter list is treated specially in order to preserve compatibility
    with existing v4 ids.
    jbms committed Mar 27, 2022
    Copy the full SHA
    7637184 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    872b3cb View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    c6decf5 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    d8ab381 View commit details
    Browse the repository at this point in the history