non static member shadows

Open
#144 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
cli

Research direction

Inspect include/boost/program_options/parsers.hpp around line 162, where clang 19.1.7 reports the inherited-member shadowing warning for m_desc. Reproduce the warning on Alma 9.6 with Boost 1.88.0 and the reported warning flags, then confirm the chosen change removes the -Wshadow-field error without changing command-line parsing behavior.

Written by the indexing model from the issue text.

Description

When compiling with clang 19.1.7 on Alma with -Werror and a number of other flags (we run with most warnings enabled), the line https://github.com/boostorg/program_options/blob/develop/include/boost/program_options/parsers.hpp#L162 was flagged with error: non-static data memeber 'm_desc' of 'basic_command_line_parser' shadows member inherited from type 'cmdline' [-Werror, -Wshadow-field]. We opted to add a local patch to suppress this using pragma push/pop at the above location. Someone with more familiarity with the code may have a more appropriate solution. If the push/pop is the desired solution, happy to submit a PR with that change included.

Env:
Alma 9.6
Boost 1.88.0 via cmake
clang 19.1.7

Dominant language
C++
Stars
136
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/program_options

All issues in boostorg/program_options

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.