breaking change: Support object member pointers - #165
Conversation
|
@codex review |
bfaf980 to
bdb9724
Compare
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
cxxheaderparser/cxxheaderparser/parser.py
Lines 2854 to 2856 in e1728ae
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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
6b849c2 to
50c208b
Compare
| parser types | ||
| ------------ | ||
|
|
||
| .. versionchanged:: 2.0 |
There was a problem hiding this comment.
Would it make sense to have this admonition on the types themselves rather than at the top here?
50c208b to
5158cf4
Compare
|
@codex review |
Build declarations from the identifier outward so pointer, reference, array, and function precedence is preserved at every nesting level. Establish the distinction between object declarators and complete type-ids, add an explicit member-pointer node, and 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 so typedefs, pointers, and named function parameters retain the same semantics and round-trip through formatting.
Model the 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, preserve declarator precedence through redundant grouping, and document the parsed-model compatibility break.
Use the broader TypeId model in aliases, template arguments, and parse_typename so bare functions and complex member-pointer types behave consistently across contexts. Keep ordinary declarators constrained to object-compatible decorated types.
Apply function-parameter adjustment to both named and abstract declarators, distinguish grouped names from function postfixes in nested contexts, and validate complete trailing return types without rejecting legal wrapped function types.
There was a problem hiding this comment.
💡 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".
5158cf4 to
6b7ac8f
Compare
|
@codex review |
There was a problem hiding this comment.
💡 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".
| grouped_parameter_name_ok | ||
| and len(toks) == 1 | ||
| and toks[0].type in ("NAME", "final") |
There was a problem hiding this comment.
Recognize grouped array parameter declarators
When a parameter name and its array suffix are grouped together, as in the valid declaration void f(int (p[3]));, this single-token check fails to classify (p[3]) as a grouped declarator. The parser consequently interprets it as a function-type parameter list and returns an anonymous pointer-to-function type whose parameter is p[3], instead of the named array parameter that the parent revision produced. Accept a parameter name followed by array suffixes as a grouped declarator.
Useful? React with 👍 / 👎.
This will result in cxxheaderparser 2.x