← Back to Pull requests

Do not instantiate unsatisfied members to deduce their return type #1136

Closed
unknown closed this pull request without merging on Oct 05, 2026 10:57 UTC
View on GitHub
unknown unknown commented on Oct 05, 2026 08:40 UTC
Author

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.

GetFunctionReturnType instantiates the body of a member of a class template
specialization whose return type is an undeduced auto, so that the return type is
deduced. It does so without checking the member's trailing requires-clause. For a member
whose constraints are not satisfied by the specialization, such as

template <typename T> struct P {
  T m_value;
  auto size() const requires requires { m_value.size(); } {
    return m_value.size();
  }
};

queried on P<int>, the instantiation is ill-formed. Clang emits errors and marks the
member invalid:

error: member reference base type 'const int' is not a structure or union
      return m_value.size();
             ~~~~~~~^~~~~
note: in instantiation of member function 'P<int>::size' requested here

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>, whose
size(), begin(), key(), makeHandles(), operator++(int), ... are all
auto/decltype(auto) members constrained on T, and makes Gaudi tests that check
stderr fail.

This PR checks the constraints with Sema::CheckFunctionConstraints first and skips the
instantiation when they are not satisfied. Such a member cannot be called, so its return
type stays undeduced.

The new test FunctionReflection_GetFunctionReturnTypeUnsatisfiedConstraint checks that
querying 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.

Diff: 246 lines (+184 / -62) across 3 files Reviewer: vgvassilev Review duration: 136m
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
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 38.9% (MEDIUM) · Higher = larger blast radius
38.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%