Skip to content
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

Fix #41439: Update the documentation with the correct information. #69377

Conversation

Da-Viper
Copy link
Contributor

Fixes #41439

The documentation is update to say it is allowed to have omitted parameter names if the variable is not used

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 17, 2023

@llvm/pr-subscribers-clang-tidy

Author: None (Da-Viper)

Changes

Fixes #41439

The documentation is update to say it is allowed to have omitted parameter names if the variable is not used


Full diff: https://github.com/llvm/llvm-project/pull/69377.diff

1 Files Affected:

  • (modified) clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst (+7-2)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst
index 8d28c0aa02169a7..7e7099b3df251d1 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst
@@ -10,7 +10,12 @@ Guide:
 
 https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
 
-All parameters should be named, with identical names in the declaration and
-implementation.
+A parameter name may be omitted only if the parameter is not used in the
+function's definition.
+
+.. code-block:: c++
+int doingSomething(int a, int b, int) {  // Ok: the third paramet is not used
+    return a + b;
+}
 
 Corresponding cpplint.py check name: `readability/function`.

Copy link
Member

@PiotrZSL PiotrZSL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Unless you want it merged as "57949090+Da-Viper@users.noreply.github.com", please update your github config.

@PiotrZSL PiotrZSL merged commit 47a40e8 into llvm:main Dec 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

readability-named-parameter doesn't follow the guidelines correctly
4 participants