Skip to content

breaking change: Support object member pointers - #165

Merged
virtuald merged 8 commits into
mainfrom
fix/member-pointer-parsing
Aug 26, 2026
Merged

breaking change: Support object member pointers#165
virtuald merged 8 commits into
mainfrom
fix/member-pointer-parsing

Conversation

@virtuald

Copy link
Copy Markdown
Member

This will result in cxxheaderparser 2.x

@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from bfaf980 to bdb9724 Compare August 23, 2026 19:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfaf980cf8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/types.py Outdated
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0173586b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/parser.py Outdated
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 104d8c1bbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/parser.py Outdated
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if itok.type == "*"
and i > 0
and inner_toks[i - 1].type == "DBL_COLON"

P2 Badge Ignore member-pointer tokens inside grouped function suffixes

When an ordinary function-pointer declarator is redundantly grouped and one of its parameters is a member pointer, this scan mistakes the parameter's C::* for the outer declarator's operator because it searches the entire balanced token list without tracking nesting. For example, void ((*p)(int C::*)); is valid C++ and the ungrouped form now parses, but this form raises CxxParseError expecting PLACEHOLDER; restrict the search to the declarator portion/top-level nesting rather than parameter suffixes.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53b5afaafb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/types.py Outdated
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b849c2fce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/parser.py Outdated
@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from 6b849c2 to 50c208b Compare August 24, 2026 02:07
Comment thread docs/types.rst
@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from 50c208b to 5158cf4 Compare August 24, 2026 04:53
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5158cf4a42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/parser.py
@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from 5158cf4 to 6b7ac8f Compare August 24, 2026 05:08
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b7ac8f2da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cxxheaderparser/parser.py Outdated
@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from 6b7ac8f to 5e1b977 Compare August 25, 2026 04:48
@virtuald

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 1e39916768

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Build declarations from the identifier outward to preserve pointer, reference, array, and function precedence at every nesting level.
- Distinguish object declarators from complete type-ids and add an explicit member-pointer node.
- Format varargs, noexcept, qualifiers, and trailing returns consistently.
- Parse function-type cv/ref qualifiers and noexcept independently from ordinary function declarations.
- Reuse one function-type construction path across typedefs, pointers, and named function parameters.
- Preserve semantics when parsed function types are formatted again.
- Model class-member indirection as its own declarator node instead of storing an owner on FunctionType.
- Parse object and function member pointers at any nesting level while preserving grouped-declarator precedence.
- Document the parsed-model compatibility break.
- Use the broader TypeId model in aliases, template arguments, and parse_typename.
- Support bare functions and complex member-pointer types consistently across type-id contexts.
- Keep ordinary declarators constrained to object-compatible decorated types.
- Parse both named and abstract function declarators in parameter lists.
- Apply the standard function-to-pointer adjustment to function parameters.
- Treat grouped names and nested template arguments consistently so grouping does not change parameter types.
- Parse trailing returns through the complete type-id path.
- Preserve wrapped function types as legal return types.
- Reject bare array and function types, which cannot be returned directly.
- Centralize bounded token-stream swaps used by parser probes.
- Restore pending attributes and anonymous identifiers after each probe.
- Prevent speculative type-id and member-pointer parsing from leaking state into later declarations.
- Replace the separate syntax classifier with a bounded recursive declarator parse.
- Use the ordinary declarator grammar to classify grouped pointer syntax without duplicating rules.
- Handle nested grouping, parameter packs, and MSVC calling conventions.
@virtuald
virtuald force-pushed the fix/member-pointer-parsing branch from 1e39916 to 29b849b Compare August 25, 2026 14:42
@virtuald
virtuald merged commit 895ed24 into main Aug 26, 2026
33 checks passed
@virtuald
virtuald deleted the fix/member-pointer-parsing branch August 26, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants