https://github.com/chaitanyav updated
https://github.com/llvm/llvm-project/pull/99713
>From a3c7fca28faee679a59afd58c2e814025771ff63 Mon Sep 17 00:00:00 2001
From: NagaChaitanya Vellanki
Date: Fri, 19 Jul 2024 14:26:23 -0700
Subject: [PATCH] [clang-tidy] Add modernize-use-cpp-style-comments
https://github.com/chaitanyav updated
https://github.com/llvm/llvm-project/pull/99713
>From 670bf7aa89e06c2aac03dead4b980a01fe0d9426 Mon Sep 17 00:00:00 2001
From: NagaChaitanya Vellanki
Date: Fri, 19 Jul 2024 14:26:23 -0700
Subject: [PATCH] [clang-tidy] Add modernize-use-cpp-style-comments
https://github.com/chaitanyav updated
https://github.com/llvm/llvm-project/pull/99713
>From 2d45f8196e99c3b6f5a75db6e5e3df7ce1fd8aef Mon Sep 17 00:00:00 2001
From: NagaChaitanya Vellanki
Date: Fri, 19 Jul 2024 14:26:23 -0700
Subject: [PATCH] [clang-tidy] Add modernize-use-cpp-style-comments
@@ -172,6 +172,11 @@ New checks
Detects variables and functions that can be marked as static or moved into
an anonymous namespace to enforce internal linkage.
+- New :doc:`modernize-use-cpp-style-comments
5chmidti wrote:
Please sort this release note
https://github.com/carlosgalvezp requested changes to this pull request.
Good check idea! A couple of comments:
- This is not really a "modernize"check. Both styles are equally valid and it's
a matter of taste. Modernize is typically for checks that bump from one
standard to a newer one.
-
@@ -0,0 +1,67 @@
+//===--- UseCppStyleCommentsCheck.cpp -
clang-tidy-===//
+
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
carlosgalvezp wrote:
Good check idea! A couple of comments:
- This is not really a "modernize"check. Both styles are equally valid and it's
a matter of taste. Modernize is typically for checks that bump from one
standard to a newer one.
- Instead I think this check fits better in
@@ -0,0 +1,38 @@
+//===--- UseCppStyleCommentsCheck.h -
clang-tidy---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -172,6 +172,11 @@ New checks
Detects variables and functions that can be marked as static or moved into
an anonymous namespace to enforce internal linkage.
+- New :doc:`modernize-use-cpp-style-comments
+ ` check.
+
+ Find C Style comments and suggests to use C++
@@ -0,0 +1,67 @@
+//===--- UseCppStyleCommentsCheck.cpp -
clang-tidy-===//
+
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,67 @@
+//===--- UseCppStyleCommentsCheck.cpp -
clang-tidy-===//
+
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/99713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,16 @@
+// RUN: %check_clang_tidy -std=c++11 %s modernize-use-cpp-style-comments %t
+
+static auto PI = 3.14159265; /* value of pi upto 8 decimal places */
+// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: use C++ style comments '//'
instead of C style comments '/*...*/'
@@ -0,0 +1,12 @@
+.. title:: clang-tidy - modernize-use-cpp-style-comments
+
+modernize-use-cpp-style-comments
+
+
+Finds C-style comments and suggests to use C++ style comments `//`.
PiotrZSL wrote:
this line should be
https://github.com/PiotrZSL requested changes to this pull request.
Except nits:
- check should fix comments, not delete them.
- few tests are missing, with comments in a middle of code
https://github.com/llvm/llvm-project/pull/99713
___
cfe-commits
@@ -0,0 +1,12 @@
+.. title:: clang-tidy - modernize-use-cpp-style-comments
+
+modernize-use-cpp-style-comments
+
+
+Finds C-style comments and suggests to use C++ style comments `//`.
+
+
+.. code-block:: c++
+
+ memcpy(a, b, sizeof(int) * 5); /*
@@ -0,0 +1,38 @@
+//===--- UseCppStyleCommentsCheck.h -
clang-tidy---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,38 @@
+//===--- UseCppStyleCommentsCheck.h -
clang-tidy---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,38 @@
+//===--- UseCppStyleCommentsCheck.h -
clang-tidy---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
https://github.com/njames93 edited
https://github.com/llvm/llvm-project/pull/99713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,12 @@
+.. title:: clang-tidy - modernize-use-cpp-style-comments
+
+modernize-use-cpp-style-comments
+
+
+Finds C-style comments and suggests to use C++ style comments `//`.
+
+
+.. code-block:: c++
+
+ memcpy(a, b, sizeof(int) * 5); /*
@@ -0,0 +1,67 @@
+//===--- UseCppStyleCommentsCheck.cpp -
clang-tidy-===//
+
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,38 @@
+//===--- UseCppStyleCommentsCheck.h -
clang-tidy---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -172,6 +172,11 @@ New checks
Detects variables and functions that can be marked as static or moved into
an anonymous namespace to enforce internal linkage.
+- New :doc:`modernize-use-cpp-style-comments
+ ` check.
+
+ Find C Style comments and suggests to use C++
https://github.com/njames93 requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/99713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,16 @@
+// RUN: %check_clang_tidy -std=c++11 %s modernize-use-cpp-style-comments %t
+
+static auto PI = 3.14159265; /* value of pi upto 8 decimal places */
+// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: use C++ style comments '//'
instead of C style comments '/*...*/'
https://github.com/chaitanyav edited
https://github.com/llvm/llvm-project/pull/99713
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
27 matches
Mail list logo