PiotrZSL wrote:
@BenBlaise Clang-tidy 19 branch out is in ... a month. Any plans to finish this
? It's fine if this would get in limited scope (only for explicit casts), but
some current issues need fixes.
https://github.com/llvm/llvm-project/pull/76065
PiotrZSL wrote:
@BenBlaise Ok, no problem, then it will get into next release.
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
BenBlaise wrote:
I would like to, but I won't get around to it by then (concentrating on a
thesis defense for tomorrow).
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
PiotrZSL wrote:
@BenBlaise Any plans to finish this ? Clang-tidy 18 branch-out is in ~3 days.
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,105 @@
+// RUN: %check_clang_tidy %s readability-use-builtin-literals %t
+
+void warn_and_fix() {
+
+ (char16_t)U'a';
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use built-in literal instead of
explicit cast [readability-use-builtin-literals]
+ // CHECK-FIXES: u'a
@@ -0,0 +1,38 @@
+.. title:: clang-tidy - readability-use-builtin-literals
+
+readability-use-builtin-literals
+
+
+Finds literals explicitly casted to a type that could be expressed using
builtin prefixes or suffixes.
+
+In elementary cases, provi
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,105 @@
+// RUN: %check_clang_tidy %s readability-use-builtin-literals %t
+
+void warn_and_fix() {
+
+ (char16_t)U'a';
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use built-in literal instead of
explicit cast [readability-use-builtin-literals]
+ // CHECK-FIXES: u'a
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
https://github.com/PiotrZSL requested changes to this pull request.
Overall what is now is +- working.
Few fixes are still needed to tests, code, maybe some tiny refactoring and code
formatting.
Consider adding support for implicit casts:
```
unsigned X = 10;
`-VarDecl col:10 X 'unsigned int'
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+.. title:: clang-tidy - readability-use-builtin-literals
+
+readability-use-builtin-literals
+
+
+Finds literals explicitly casted to a type that could be expressed using
builtin prefixes or suffixes.
EugeneZelenk
https://github.com/EugeneZelenko edited
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/EugeneZelenko requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/76065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,161 @@
+//===--- UseBuiltinLiteralsCheck.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: Ap
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 7767c5856d85cd1acf2efc32f77fdf07f00f9ff4
b4d7dbcf67117471a2d7025013fb1fcd188b33b6 --
llvmbot wrote:
@llvm/pr-subscribers-clang-tidy
Author: None (BenBlaise)
Changes
Finds literals explicitly casted to a type that could be expressed using
builtin prefixes or suffixes.
In elementary cases, provides automated fix-it hints.
```cpp
(char)'a';/
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be
notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it i
https://github.com/BenBlaise created
https://github.com/llvm/llvm-project/pull/76065
Finds literals explicitly casted to a type that could be expressed using
builtin prefixes or suffixes.
In elementary cases, provides automated fix-it hints.
```cpp
(char)'a';//
27 matches
Mail list logo