← Back to Pull requests

[libcu++] Suppress MSVC warning C5285 at the forward declaration of `std::tuple` #12808

Closed
unknown closed this pull request without merging on Nov 25, 2026 17:27 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 10:57 UTC
Author

Description

Starting with toolset 14.51, the MSVC STL marks std::tuple with [[msvc::no_specializations]]. For an explicit specialization, MSVC reports the violation at the first declaration of the primary template and uses the warning state at that line. The STL disables C5285 in its own headers, so its own std::tuple<> in <tuple> is silent as long as <utility> declares std::tuple first.

If a libcu++ header comes first, the first declaration is the forward declaration in <cuda/std/__fwd/tuple.h>, and a later <tuple> makes MSVC warn there about the STL's own std::tuple<>:

cuda/std/__fwd/tuple.h(29): warning C5285: cannot declare a specialization for 'std::tuple': Specializing this standard library template is forbidden by N5014 [tuple.tuple.general]/1

In host code, even <cuda/std/type_traits> followed by <vector> warns, and C5285 is a level 1 warning, so /WX builds break. nvcc is not affected, because cuda_runtime.h includes <utility> before any libcu++ header.

This PR suppresses C5285 around the forward declaration. std::tuple is the only template marked by the MSVC STL that libcu++, Thrust, CUB or cudax forward declare or specialize. When every libcu++ public header is compiled host-only with MSVC 19.51 at /W4, followed by every STL header, 73 of 254 headers warn in C++17 and 72 in C++20 and C++23 without this change, and none with it.

CI's newest MSVC is 14.50, whose STL does not mark std::tuple yet. With 14.51, the existing host-only public header tests catch this, for example for <cuda/std/string_view>.

Checklist


  • New or existing tests cover these changes.

  • The documentation is up to date with these changes.
  • Diff: 215 lines (+161 / -54) across 2 files Reviewer: Jacobfaib Review duration: 389m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 215 lines diff across 2 files
    0.37
    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.322
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #12808"
    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: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    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: 14.5% · Safe to merge
    14.5%
    Repository