Skip to content

Fix function pointer typedef simplification (Trac #5935) - #8840

Open
Moltiz wants to merge 1 commit into
cppcheck-opensource:mainfrom
Moltiz:autosell/cppcheck-5935-typedef-function-pointer
Open

Fix function pointer typedef simplification (Trac #5935)#8840
Moltiz wants to merge 1 commit into
cppcheck-opensource:mainfrom
Moltiz:autosell/cppcheck-5935-typedef-function-pointer

Conversation

@Moltiz

@Moltiz Moltiz commented Sep 8, 2026

Copy link
Copy Markdown

Fixes Trac #5935.

The function-pointer typedef simplifier treated the opening parenthesis in a use such as FunctionPointer *(name) as a function parameter list. That discarded the typedef's actual parameter range and produced an incomplete declaration.

This change recognizes that parenthesized pointer declarator and keeps the function-pointer parameter list. The regression covers both C and C++ simplification.

Validation on Windows with MSVC:

  • TestSimplifyTypedef::cfp8
  • TestSimplifyTypedef, TestTokenize, TestSymboldatabase, TestVarID, and TestTokenizer: 1,344 tests, 0 failures

This contribution was implemented and tested autonomously by OpenAI Codex under the GitHub account owner's authorization. The account owner handles identity and any payment administration.

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.

1 participant