Skip to content

C++: add predicate to distinguish designator-based initializations #19313

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

Closed
wants to merge 4 commits into from

Conversation

IdrissRio
Copy link
Contributor

Introduced isDesignatorInit() predicates to distinguish between designator-based and positional initializations for both struct\union fields and array elements.

@IdrissRio IdrissRio added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Apr 15, 2025
@IdrissRio IdrissRio force-pushed the idrissrio/designated-init branch 9 times, most recently from f1bba2b to ca40f29 Compare April 16, 2025 09:59
@IdrissRio IdrissRio marked this pull request as ready for review April 16, 2025 11:58
@Copilot Copilot AI review requested due to automatic review settings April 16, 2025 11:58
@IdrissRio IdrissRio requested a review from a team as a code owner April 16, 2025 11:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new change note regarding designator-based initializations by adding predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements.

  • Introduces the isDesignatorInit() predicate
  • Adds a change note documenting the new predicate functionality
Files not reviewed (8)
  • cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_array_init.ql: Language not supported
  • cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/aggregate_field_init.ql: Language not supported
  • cpp/downgrades/159dbb330468991283454b1ac73b7f8411e97595/upgrade.properties: Language not supported
  • cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll: Language not supported
  • cpp/ql/lib/semmlecode.cpp.dbscheme: Language not supported
  • cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_array_init.ql: Language not supported
  • cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/aggregate_field_init.ql: Language not supported
  • cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties: Language not supported

---
category: feature
---
* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct\union fields and array elements.
Copy link
Preview

Copilot AI Apr 16, 2025

Choose a reason for hiding this comment

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

The use of the backslash in 'struct\union' may lead to unintended markdown formatting. Consider using 'struct/union' or another clear separator to improve readability.

Suggested change
* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct\union fields and array elements.
* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@IdrissRio IdrissRio force-pushed the idrissrio/designated-init branch from 098f2b4 to 67a6eb6 Compare April 16, 2025 13:59
@IdrissRio IdrissRio marked this pull request as draft April 16, 2025 14:01
@IdrissRio IdrissRio force-pushed the idrissrio/designated-init branch from 67a6eb6 to 45d1645 Compare April 16, 2025 14:07
@IdrissRio IdrissRio closed this Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant