Skip to content

Fix SAL annotation placement on function templates#5895

Merged
guhetier merged 1 commit intomainfrom
guhetier/fix_sal_annotations
Mar 26, 2026
Merged

Fix SAL annotation placement on function templates#5895
guhetier merged 1 commit intomainfrom
guhetier/fix_sal_annotations

Conversation

@guhetier
Copy link
Copy Markdown
Collaborator

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 25, 2026 19:32
@guhetier guhetier enabled auto-merge (squash) March 26, 2026 16:10
@guhetier guhetier merged commit 21e7483 into main Mar 26, 2026
631 of 644 checks passed
@guhetier guhetier deleted the guhetier/fix_sal_annotations branch March 26, 2026 16:42
guhetier added a commit that referenced this pull request Mar 27, 2026
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`

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

No documentation impact.
guhetier added a commit that referenced this pull request Mar 27, 2026
## 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 added a commit that referenced this pull request Mar 30, 2026
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.
guhetier added a commit that referenced this pull request Mar 30, 2026
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`

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

No documentation impact.
guhetier added a commit that referenced this pull request Mar 30, 2026
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.
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