[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-06-10 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-21 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-21 Thread via 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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-20 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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. + +In elementary cases,

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2024-01-05 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via 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.

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via 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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via 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:

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via cfe-commits
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 --

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via cfe-commits
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';

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via cfe-commits
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

[clang-tools-extra] [clang-tidy] Add readability-use-builtin-literals check (PR #76065)

2023-12-20 Thread via cfe-commits
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';