Skip to content

Add missing square brackets for [[nodiscard]] in C4834 reference #5422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-warnings/c4834.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn about the cause and fixes for Compiler warning (level 1) C4834."
title: "Compiler warning (Level 1) C4834"
description: "Learn about the cause and fixes for Compiler warning (level 1) C4834."
ms.date: 01/18/2024
f1_keywords: ["C4834"]
helpviewer_keywords: ["C4834"]
Expand Down Expand Up @@ -43,7 +43,7 @@ int square_of(int i) { return i * i; }
int main()
{
square_of(42); // warning C4834: discarding return value of function with 'nodiscard' attribute
// If ignoring the [[nodiscard] attribute is unintentional, make use of the return value as intended:
// If ignoring the [[nodiscard]] attribute is unintentional, make use of the return value as intended:
// For example:
std::cout << "square_of(42) = " << square_of(42) << "\n"; // Ok
// Or:
Expand Down