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++, fix non-type template parameter parsing #8037

Merged
merged 1 commit into from Aug 2, 2020

Conversation

jakobandersen
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Detail

See #7944 (comment)

Relates

Fixes #7944

@jakobandersen jakobandersen added this to the 3.2.0 milestone Aug 2, 2020
@jakobandersen jakobandersen self-assigned this Aug 2, 2020
@jakobandersen jakobandersen merged commit 89df9a1 into sphinx-doc:3.x Aug 2, 2020
@jakobandersen jakobandersen deleted the cpp_template_nontype branch August 2, 2020 09:22
@fetzerch
Copy link

This seemed to introduce an issue with template template parameters if they don't appear as first argument:

A template declaration such as:

template<typename T, template<typename> typename U> A

now triggers the following warning:

WARNING: Error in template parameter list.
If parameter:
  Error when parsing template parameter.
  If unconstrained type parameter or template type parameter:
    Invalid C++ declaration: Expected 'typename' or 'class' in tbe beginning of template type parameter. [error at 21]
      template<typename T, template<typename> typename U> A
      ---------------------^
  If constrained type parameter or non-type parameter:
    Invalid C++ declaration: Expected identifier in nested name, got keyword: template [error at 29]
      template<typename T, template<typename> typename U> A
      -----------------------------^
If no parameter:
  Invalid C++ declaration: Expected "," or ">". [error at 21]
    template<typename T, template<typename> typename U> A
    ---------------------^

@jakobandersen
Copy link
Contributor Author

@fetzerch, thanks! Turns out it didn't parse the space in front of template until after it tried to parse template it self, but it should be fixed in the next version (#8078).

@fetzerch
Copy link

@jakobandersen Cheers, just confirming that 3.2.1 solved the template template argument parsing.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sphinx.util.cfamily.DefinitionError: Error in template parameter list.
2 participants