Do not instantiate unsatisfied members to deduce their return type #1136
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 246 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1136"
general
weight: 0.35
vgvassilev
The following is a fix for an issue (the error message below, in this case a similar one) that has been seen today in LCG builds, concretely when running Gaudi's tests, and it didn't happen on Saturday. If merged, please upstream to ROOT.
GetFunctionReturnTypeinstantiates the body of a member of a class templatespecialization whose return type is an undeduced
auto, so that the return type isdeduced. It does so without checking the member's trailing requires-clause. For a member
whose constraints are not satisfied by the specialization, such as
queried on
P<int>, the instantiation is ill-formed. Clang emits errors and marks themember invalid:
Bindings that query the return types of all methods of a class therefore print one such
error for every unsatisfied constrained member of every class template they expose. In
ROOT's cppjit-based PyROOT this happens for Gaudi's
Gaudi::Property<T>, whosesize(),begin(),key(),makeHandles(),operator++(int), ... are allauto/decltype(auto)members constrained onT, and makes Gaudi tests that checkstderr fail.
This PR checks the constraints with
Sema::CheckFunctionConstraintsfirst and skips theinstantiation when they are not satisfied. Such a member cannot be called, so its return
type stays undeduced.
The new test
FunctionReflection_GetFunctionReturnTypeUnsatisfiedConstraintchecks thatquerying unsatisfied members prints nothing and leaves them valid, and that a satisfied
member still gets its deduced return type. Without the change it fails with the errors
above.