Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

context::set_language does not correctly set __cplusplus

Offen
#263 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@martis42 arbeitet bereits daran.

Seit 27.9.2026.

  • #264 von @martis42 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
56/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp
Bereich
compilers

Rechercherichtung

Start by locating context::set_language and the boost:👋:language_support definitions, then inspect how each language mode assigns __cplusplus. Compare the existing values with the documented C++ standard values in the linked reference. Done means released C++ versions have dedicated support_cppXX values and preprocessing reports the corresponding __cplusplus value.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I am using wave as library in a tool which preprocesses C++ code to obtain some information and then lint it.
This requires preprocessing the code with a proper value for __cplusplus, as the code might use different #if .. branches depending on the value.

I know the C++ standard of the project. But I can't set __cplusplus myself because it is a special value which wave ignores when using the context::remove_macro_definition or context::add_macro_definition functions. This is fine, since the public API context::set_language exists.

However, I believe this API does not behave as expected:

On the other hand, boost::wave::language_support::support_cpp, boost::wave::language_support::support_cpp11 and boost::wave::language_support::support_cpp20 cause __cplusplus to be set to the expected value.

I believe wave should offer a dedicated boost::wave::language_support::support_cppXX value for each released C++ version and set __cplusplus accordingly for preprocessing according to the values documented here

If you agree with the request I am happy to create a contribution for that.

Vorherrschende Sprache
C++
Sterne
29
Forks
56
Ø Merge
3 T. 6 Std.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus boostorg/wave

Alle Issues in boostorg/wave

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.