context::set_language does not correctly set __cplusplus
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:
boost::wave::language_support::support_cpp14does not exists, thus one cannot set__cplusplusaccordinglyboost::wave::language_support::support_cpp17sets__cplusplusto199711L, aka C++98boost::wave::language_support::support_cpp23sets__cplusplusto199711L, aka C++98boost::wave::language_support::support_cpp14boost::wave::language_support::support_cpp26does not exists, thus one cannot set__cplusplusaccordingly. To be fair, C++26 is quite new and this point is more for completeness sake.
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.
- 主要语言
- C++
- 星标
- 29
- 派生
- 56
- 平均合并
- 3 天 23 小时
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/wave 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed?未关闭
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 45/100
相似的 Issue
-
Mac mini M6 (16 GB): Q2_0 streaming works - measured 11.7->27.2 tok/s + arena fix for sub-32 GB Macs未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
champion good first issue remake source/qq
难度 2/5 1-3 小时 新手友好度 65/100
metasequoiaime/msime-windows#1025 ·
维护者通常 1 天内回复
-
backlog bug
难度 2/5 1-3 小时 新手友好度 75/100
EchoTools/nevr-runtime#653 ·
维护者通常 1 天内回复
-
`--fail-require-skip` never fires: run_tests.py searches stdout, but the unittest binary writes the skip summary to stderr可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
InfiniTimeOrg/InfiniTime#2492 ·