fix(en/cpp11): sync xmake.lua with zh + add missing cpp11-15-variadic-templates#42
Merged
Sunrisepeak merged 1 commit intomainfrom Apr 25, 2026
Merged
Conversation
…plates
- Add set_languages("c++17") to cpp11-08-literal-type-0 to match zh
(fixes #37: 'non-constexpr operator[]' compile error swallowing the
intended teaching errors about constexpr std::string)
- Fix indentation of set_optimize / -fno-elide-constructors in
cpp11-04-rvalue-references and -Wpedantic -Werror in
cpp11-07-constexpr-0 so they correctly scope to the surrounding
target instead of leaking to file scope
- Add cpp11-15-variadic-templates-0/1 targets and English-translated
source files (previously zh-only — en users had no way to run
cpp11-15 exercises)
After this commit, dslings/cpp11/xmake.lua and
dslings/en/cpp11/xmake.lua are byte-identical.
Local verification: with `xmake f --lang=en` and the new
set_languages("c++17") line, building cpp11-08-literal-type-0 now
produces the same 3 teaching errors as the zh version
("const std::string ... is not literal", etc.), instead of the
C++11-era 'non-constexpr operator[]' error that obscured the lesson.
Closes #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dslings/en/cpp11/xmake.luawas missingset_languages("c++17")for thecpp11-08-literal-type-0target that the zh version already had. With C++11 default, the practice file errored onnon-constexpr operator[]ofstd::array, obscuring the actual teaching errors aboutconstexpr std::stringnot being a literal type.cpp11-04-rvalue-references:set_optimize("none")andadd_cxxflags("-fno-elide-constructors")were unindented in en, leaking to file scope. Indented them to match zh.cpp11-07-constexpr-0:add_cxxflags("-Wpedantic -Werror")had the same indentation issue. Fixed.cpp11-15-variadic-templates-0/1: targets + source files were missing entirely from en. Added the xmake targets and English-translated source files.After this PR,
dslings/cpp11/xmake.luaanddslings/en/cpp11/xmake.luaare byte-identical.Test plan
xmake f --lang=en && xmake build cpp11-08-literal-type-0now produces the same 3 teaching errors as zh ('const std::string' ... is not literal, etc.) instead of the priornon-constexpr operator[]error.xmake build cpp11-04-rvalue-referencesandcpp11-07-constexpr-0still build (and stop at their respectiveD2X_YOUR_ANSWERplaceholder errors as expected).xmake build cpp11-15-variadic-templates-0andcpp11-15-variadic-templates-1resolve to the new English source files (and stop atD2X_YOUR_ANSWERplaceholder errors as expected).diff dslings/cpp11/xmake.lua dslings/en/cpp11/xmake.luareturns nothing.Closes #37