Skip to content

beast: set_server_name is [[nodiscard]], and beast asks for the nodiscard results rule - #3

Merged
pinhopro merged 1 commit into
mainfrom
nodiscard-results
Nov 16, 2026
Merged

pinhopro merged 1 commit into
mainfrom
nodiscard-results

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

Summary

boost::system::result carries no [[nodiscard]] of its own, so a caller that drops what
set_server_name returns would not see a refused server name and would connect without the SNI
it asked for. The member and the free function are now [[nodiscard]], and meta/lint.json asks
for the superproject's nodiscard results lint rule, which keeps every function of include/
that returns boost::system::result so.

The branch sits on main (handshake-limit included). The superproject records this commit as
libs/beast in webcpporg/webcpp's nodiscard/v0.1 pull request, which merges after the crypto and
hash ones.

Changes

  • include/webcpp/beast/browser/ssl_stream.hpp: [[nodiscard]] on ssl_stream::set_server_name
    and the free set_server_name (Doc Comments unchanged).
  • meta/lint.json: "nodiscard-results" and its reason.
  • doc/changelog.adoc: one line.

Verification

  • No call site changed: every test and example already uses the result. The native, wasip2, wasip3,
    Emscripten and gcc-15 lanes compile beast's tests and examples with warnings as errors and report
    no discarded result, from scratch, in the superproject's nodiscard/v0.1 tree with this commit
    recorded: native 28, wasip2 27, wasip3 28, Emscripten 28, gcc-15 28 tests passed, 0 failed.
  • The superproject's lint, rule nodiscard results included: lint: clean (2267 compile
    commands).

🤖 Generated with Claude Code

@pinhopro
pinhopro merged commit 0cfc0a5 into main Nov 16, 2026
15 of 66 checks passed
@pinhopro
pinhopro deleted the nodiscard-results branch November 17, 2026 04:06
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.

1 participant