Conversation
Kitsune44
marked this pull request as draft
September 28, 2026 04:04
Kitsune44
marked this pull request as ready for review
September 28, 2026 04:35
anf3is
suggested changes
Sep 28, 2026
anf3is
left a comment
Contributor
There was a problem hiding this comment.
Well, I skipped part with EHANDLE and convar callbacks, but in general looks fine.
Otherwise I would suggest some minor changes. (And to to be honest, I believe that cpp version agnostic changes like the whole (const char*) story deserve their own PR.)
Kitsune44
marked this pull request as draft
September 29, 2026 12:18
Kitsune44
force-pushed
the
cpp20
branch
3 times, most recently
from
September 29, 2026 13:26
e56c2ad to
2eea42a
Compare
The three projects are switched to /std:c++20 (LanguageStandard=stdcpp20) in every configuration. No conformance switch was relaxed: neither /Zc:twoPhase- nor /Zc:strictStrings- was added.
Dependent base members and file-scope declarations are found again: this-> where the base is dependent, explicit declarations and out-of-line definitions, and the missing includes (math.h for log10, tier1/KeyValues.h, fgdlib/WCKeyValues.h). The Debug configuration needed this-> as well, where Assert and #ifdef _DEBUG compile the call out in Release.
KeyValues is a complete type where it is instantiated (Panel.h) and CSortedCacheFile is defined before its first use (UtlCachedFileData.h).
concept became a keyword in C++20. Renamed 216 identifiers from concept to conceptName across the AI speech, passenger and response-rule code, leaving comments and string literals untouched.
The clamp macro in mathlib.h was expanded inside <algorithm> and broke it. The macro is gone; the C++ clamp template in tier0/basetypes.h is the only clamp and takes the two bound types separately with an explicit result conversion. The macro branch left there is the C one (#else of #ifdef __cplusplus).
The datatable API is const-correct now (dt_recv, dt_send, dt_utlvector_recv, dt_utlvector_send, ClientClass, ServerClass, recvproxy, sendproxy), which fixes the RECVINFO/SENDINFO macro call sites without touching the tables. The remaining literal sites were fixed by making the local const or by const-correcting the in-repo signature; explicit casts are kept only at engine boundaries.
false is not a null pointer constant in conformance mode: chunkfile.cpp returns NULL, and the GetLocalTeam() result is compared against NULL instead of being used as a bool-to-pointer conversion.
The string-returning virtuals are const char * now (GetEngineSound, GetScannerSoundPrefix, GetDeathNoticeName, GetFixedCameraEntityName and the particle definition members) in the headers and in their definitions, which removes the casts their callers needed.
friend static is not a valid declaration: the console command handlers in rd_workshop.h are static at namespace scope only.
Temporaries cannot bind to non-const references. Instead of keeping a local at every call site, the in-repo callees take const Vector& / const QAngle& (Tracer_Draw, CSnowFallManager::FindSnowVolumes, SetMoveTarget, the three MeleeAttack helpers, FX_MicroExplosion), and asw_broadcast_camera uses VectorLength() for the length it actually needs. The engine-side particle interfaces consume the CUtlBuffer they are given, so their call sites keep a local.
C++20 adds rewritten comparison candidates, so the legacy comparisons became ambiguous: CUtlSymbol and FileNameHandle_t results are tested with IsValid(), and EHANDLE and ScriptVariant_t are constructed explicitly at the handle and script boundaries.
Qualified member declarations are not allowed inside a class body: void CASW_Holo_Sentry::InputEnable becomes void InputEnable.
Explicit specializations of class template members are not implicitly inline, so the linker folded duplicate definitions: the four ITilegenClassFactory<T>::ReadLiteralValue specializations and C_SpatialEntityTemplate<Vector>::ResetAccumulation are marked inline.
Kitsune44
marked this pull request as ready for review
September 29, 2026 14:00
anf3is
self-requested a review
September 29, 2026 14:07
anf3is
approved these changes
Sep 29, 2026
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.
Migrate Reactive Drop from C++14 to C++20
Enables
/std:c++20(LanguageStandard=stdcpp20) for theClient (Swarm),Server (Swarm)andmissionchooserprojects in every build configuration, and fixes every error the switch surfaces.