Skip to content

[CP] Fix SAL annotation placement on function templates (#5895)#5897

Merged
guhetier merged 2 commits intorelease/2.5from
guhetier/cp_sal_fix_2_5
Mar 30, 2026
Merged

[CP] Fix SAL annotation placement on function templates (#5895)#5897
guhetier merged 2 commits intorelease/2.5from
guhetier/cp_sal_fix_2_5

Conversation

@guhetier
Copy link
Copy Markdown
Collaborator

Cherry-pick of #5895

Description

SAL annotations (_Success_, _Function_class_) placed before the template keyword cause MSVC compilation errors (C2059) when TVS / static analysis is enabled. The template head must always come first; annotations go between it and the return type.

Fixed 5 occurrences:

  • src/perf/lib/SecNetPerfMain.cpp: 4 instances of _Success_ before template
  • src/test/lib/ApiTest.cpp: 1 instance of _Function_class_ before template

Testing

Existing tests cover this change. No new tests needed — this is a compilation fix only (no behavioral change).

Documentation

No documentation impact.

## Description
SAL annotations (`_Success_`, `_Function_class_`) placed before the
`template` keyword cause MSVC compilation errors (C2059) when TVS /
static analysis is enabled. The `template` head must always come first;
annotations go between it and the return type.

Fixed 5 occurrences:
- `src/perf/lib/SecNetPerfMain.cpp`: 4 instances of `_Success_` before
`template`
- `src/test/lib/ApiTest.cpp`: 1 instance of `_Function_class_` before
`template`

## Testing
Existing tests cover this change. No new tests needed — this is a
compilation fix only (no behavioral change).

## Documentation
No documentation impact.
@guhetier guhetier requested a review from a team as a code owner March 27, 2026 16:46
@mtfriesen
Copy link
Copy Markdown
Contributor

Should the perl action/CP be a separate chore?

@guhetier
Copy link
Copy Markdown
Collaborator Author

Should the perl action/CP be a separate chore?

It can if you feel strongly, I wanted to check fast it was enough to solve the failure.

@mtfriesen
Copy link
Copy Markdown
Contributor

Should the perl action/CP be a separate chore?

It can if you feel strongly, I wanted to check fast it was enough to solve the failure.

I think ideally they're separate, but I don't feel strongly at all.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.02%. Comparing base (20d5202) to head (5c1bc63).
⚠️ Report is 1 commits behind head on release/2.5.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.5    #5897      +/-   ##
===============================================
- Coverage        87.18%   86.02%   -1.16%     
===============================================
  Files               59       59              
  Lines            18209    18209              
===============================================
- Hits             15875    15665     -210     
- Misses            2334     2544     +210     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier guhetier merged commit debf17e into release/2.5 Mar 30, 2026
331 of 337 checks passed
@guhetier guhetier deleted the guhetier/cp_sal_fix_2_5 branch March 30, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants