Skip to content

asio: make_tls_client_context is [[nodiscard]], and asio asks for the nodiscard results rule - #6

Merged
pinhopro merged 2 commits into
mainfrom
nodiscard-results
Nov 16, 2026
Merged

pinhopro merged 2 commits 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 a
make_tls_client_context result, a context or its refusal, would go on as if the context trusted
its authorities. Both overloads 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.

This branch stacks on fix/diagnostic-directives (its own pull request): until that one merges,
this one shows its commit too. The superproject records this commit as libs/asio in
webcpporg/webcpp's nodiscard/v0.1 pull request, which merges after the crypto and hash ones.

Changes

  • include/webcpp/asio/tls_client_context.hpp: [[nodiscard]] on both overloads (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 asio'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 78, wasip2 34, wasip3 84, Emscripten 113, gcc-15 70 tests passed, 0 failed.
  • The superproject's lint, rule nodiscard results included: lint: clean (2267 compile
    commands).

🤖 Generated with Claude Code

R added 2 commits November 16, 2026 02:38
Three compile-diagnostic tests wrapped their expected text over two // lines. clang's -verify cannot find the closing }} there, reports an error the rule ignores, and drops the directive, so the tests checked nothing. Each now states a shorter part of the message on one line.
@pinhopro
pinhopro merged commit 6c392b6 into main Nov 16, 2026
42 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