[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

2024-01-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/78200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Warning for incorrect useof 'pure' attribute (PR #78200)

2024-01-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > LGTM, thank you! > > What's next? I cannot push changes Thanks for mentioning that; I've pushed the changes on your behalf. Thank you for the improvements! https://github.com/llvm/llvm-project/pull/78200 ___ cfe-commits maili

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,44 @@ +//===--- UseStdMinMaxCheck.h - clang-tidy ---*- C++ -*-===// +// +// 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: Apa

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel converted_to_draft https://github.com/llvm/llvm-project/pull/78847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel ready_for_review https://github.com/llvm/llvm-project/pull/78847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix handling of functional cast in google-readability-casting (PR #71650)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix handling of functional cast in google-readability-casting (PR #71650)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -18,19 +18,22 @@ namespace clang::tidy::google::readability { void AvoidCStyleCastsCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { + 5chmidti wrote: Intended newline? https://github.com/llvm/llvm-project/pull/71650 __

[clang-tools-extra] [clang-tidy] Fix handling of functional cast in google-readability-casting (PR #71650)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/71650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Draft] Basic JITLink AArch32 support for clang-repl (PR #77313)

2024-01-20 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail updated https://github.com/llvm/llvm-project/pull/77313 From ab1fa3773766072882666a16682e985bbd9cd72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Thu, 18 Jan 2024 17:26:33 +0100 Subject: [PATCH 1/9] [JITLink][AArch32] Add GOT builder

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Bhuminjay Soni via cfe-commits
11happy wrote: I did this only the ``` compoundStmt(statementCountIs(1), has(binaryOperator(...))) ``` error: ```LLVM/llvm-project/clang-tools-extra/test/clang-tidy/checkers/readability/use-std-min-max.cpp:148:19: error: CHECK-FIXES: expected string not found in input``` this one is failing in

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,175 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 requested changes to this pull request. @11happy I've left a few more comments regarding some minor issues with your check. Please have a look and let me know what you think. https://github.com/llvm/llvm-project/pull/77816

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[clang] ec0ac85 - [Clang][Obvious] Correctly disable Windows on linker-wrapper test

2024-01-20 Thread Joseph Huber via cfe-commits
Author: Joseph Huber Date: 2024-01-20T12:53:03-06:00 New Revision: ec0ac85e58f0a80cc52a132336b132ffe7b50b59 URL: https://github.com/llvm/llvm-project/commit/ec0ac85e58f0a80cc52a132336b132ffe7b50b59 DIFF: https://github.com/llvm/llvm-project/commit/ec0ac85e58f0a80cc52a132336b132ffe7b50b59.diff

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang-tools-extra] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL commented: Just few nits after quick look https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,42 @@ +//===--- UseStdMinMaxCheck.h - clang-tidy ---*- C++ -*-===// +// +// 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: Apa

[clang] [llvm] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [flang] [openmp] [llvm] [compiler-rt] [libc] [libcxx] [clang] [lld] [lldb] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1130,6 +1137,19 @@ using __best_match_t = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, } // namespace __variant_detail +template < class _Visitor, class... _Vs, typename = void_t()))...> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS

[lld] [clang] [llvm] [compiler-rt] [openmp] [lldb] [clang-tools-extra] [flang] [libc] [libcxx] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1130,6 +1137,19 @@ using __best_match_t = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, } // namespace __variant_detail +template < class _Visitor, class... _Vs, typename = void_t()))...> > mordante wrote: Clang-format needs to be compatible

[libc] [openmp] [libcxx] [flang] [lld] [clang-tools-extra] [llvm] [compiler-rt] [lldb] [clang] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante requested changes to this pull request. Mostly LGTM, I like to see it again for a quick look. https://github.com/llvm/llvm-project/pull/76447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[lldb] [llvm] [compiler-rt] [flang] [openmp] [clang] [clang-tools-extra] [lld] [libcxx] [libc] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante edited https://github.com/llvm/llvm-project/pull/76447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [libcxx] [compiler-rt] [libc] [lldb] [lld] [clang-tools-extra] [flang] [openmp] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,48 @@ +//===--===// +// +// 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: Apac

[clang] [libc] [flang] [openmp] [lld] [llvm] [libcxx] [clang-tools-extra] [compiler-rt] [lldb] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1267,7 +1267,11 @@ def add_version_header(tc): }, { "name": "__cpp_lib_variant", -"values": {"c++17": 202102}, +"values": { +"c++17": 202102, # std::visit for classes derived from std::variant +

[compiler-rt] [clang] [lld] [openmp] [libc] [llvm] [lldb] [libcxx] [flang] [clang-tools-extra] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1130,6 +1137,19 @@ using __best_match_t = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, } // namespace __variant_detail +template < class _Visitor, class... _Vs, typename = void_t()))...> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS

[openmp] [clang] [lld] [libc] [lldb] [llvm] [libcxx] [clang-tools-extra] [compiler-rt] [flang] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,357 @@ +//===--===// +// +// 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: Apa

[libc] [lld] [compiler-rt] [libcxx] [lldb] [clang-tools-extra] [flang] [llvm] [openmp] [clang] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1273,6 +1293,24 @@ public: __impl_.__swap(__that.__impl_); } +# if _LIBCPP_STD_VER >= 26 && defined(_LIBCPP_HAS_EXPLICIT_THIS_PARAMETER) + struct __variant_visit_barrier_tag { // unnamable when using standard library modules mordante wrote: I'm n

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,139 @@ +//===--- UseStdMinMaxCheck.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

[openmp] [clang] [lld] [libc] [lldb] [llvm] [libcxx] [clang-tools-extra] [compiler-rt] [mlir] [flang] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante edited https://github.com/llvm/llvm-project/pull/76449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [mlir] [llvm] [openmp] [compiler-rt] [libcxx] [lld] [flang] [libc] [lldb] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -470,4 +470,9 @@ inline Tp const& DoNotOptimize(Tp const& value) { # define TEST_IF_AIX(arg_true, arg_false) arg_false #endif +// Clang-18 has support for deducing this, but it does not set the FTM. +#if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER)

[flang] [clang] [mlir] [llvm] [libcxx] [libc] [lld] [lldb] [compiler-rt] [clang-tools-extra] [openmp] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante approved this pull request. Thanks LGTM modulo a few minor comment. https://github.com/llvm/llvm-project/pull/76449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [lld] [lldb] [flang] [mlir] [llvm] [libcxx] [libc] [openmp] [compiler-rt] [clang-tools-extra] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -7,7 +7,8 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME -// XFAIL: clang-16 || clang-17 +// The tested functionality needs deducing this. +// UNSUPPORTED: clang-16 || clang-17 || apple-clang mordante wro

[openmp] [llvm] [mlir] [lldb] [clang] [compiler-rt] [lld] [libc] [libcxx] [flang] [clang-tools-extra] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
@@ -1513,6 +1519,11 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK # endif +// Clang-18 has support for deducing this, but it does not set the FTM. +#if defined(__cpp_explicit_this_

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,175 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,175 @@ +// RUN: %check_clang_tidy %s readability-use-std-min-max %t + +#define MY_MACRO_MIN(a, b) ((a) < (b) ? (a) : (b)) + +constexpr int myConstexprMin(int a, int b) { + return a < b ? a : b; +} + +constexpr int myConstexprMax(int a, int b) { + return a > b ? a : b;

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
@@ -0,0 +1,135 @@ +//===--- UseStdMinMaxCheck.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

[clang-tools-extra] [clang] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 requested changes to this pull request. https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[openmp] [libc] [mlir] [lld] [llvm] [clang] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libcxx] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Hristo Hristov via cfe-commits
@@ -0,0 +1,357 @@ +//===--===// +// +// 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: Apa

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread via cfe-commits
XDeme wrote: @HazardyKnusperkeks ping https://github.com/llvm/llvm-project/pull/77868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-20 Thread Björn Schäpers via cfe-commits
@@ -3392,6 +3392,24 @@ the configuration (without a prefix: ``Auto``). Priority:1 SortPriority:0 +.. _MainIncludeChar: HazardyKnusperkeks wrote: There's a script: `clang/doc/tools/dump_format_style.py`. https://github.com/llvm/llv

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-20 Thread Björn Schäpers via cfe-commits
@@ -0,0 +1,27 @@ +// Test the combination of regrouped include directives, via regexes and HazardyKnusperkeks wrote: I've never run anything but the unit tests. I'd remove these, but I have no strong opinion on that matter. https://github.com/llvm/llvm-project/

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-20 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > > I think splitting the two features would be better. > > I'm going to close this MR and create two new ones. > > > Also please add a note to the changelog. > > Where can I find the changelog? `clang/docs/ReleaseNotes.rst` https://github.com/llvm/llvm-project/pull

[clang] [clang-format] Do not update cursor pos if no includes replacement (PR #77456)

2024-01-20 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: > Oh, sorry @HazardyKnusperkeks I missed this in your previous comment. > > I've updated the PR. > > As a side note, I tried adding these two tests but they fail, meaning the > cursor is still incorrectly computed with CRLF when replacing lines. > > This is due to ad

[clang] [clang-format] Support of TableGen statements in unwrapped line parser (PR #78846)

2024-01-20 Thread Björn Schäpers via cfe-commits
@@ -2743,6 +2760,14 @@ FormatToken *UnwrappedLineParser::parseIfThenElse(IfStmtKind *IfKind, } } + // TableGen's if statement has the form of `if then { ... }`. + if (Style.isTableGen()) { +while (!eof() && !(FormatTok->is(Keywords.kw_then))) { H

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Björn Schäpers via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); HazardyKnusperkeks wrote: I'm in favor. Just for the correctness. https://github.com/llvm/llvm-project/pull/78847

[openmp] [libc] [mlir] [lld] [llvm] [clang] [clang-tools-extra] [compiler-rt] [lldb] [flang] [libcxx] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Hristo Hristov via cfe-commits
@@ -1513,6 +1519,11 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK # endif +// Clang-18 has support for deducing this, but it does not set the FTM. +#if defined(__cpp_explicit_this_

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,129 @@ +//===--- UseStdMinMaxCheck.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

[clang] [clang-tools-extra] [llvm] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti commented: @11happy, regarding the statement count: The tests work when I add `statementCountIs(1),` right after `compoundStmt(` -> `compoundStmt(statementCountIs(1),`. I removed the bound node, `Compound` and the `Compoind->size() > 1` check. But the tests should st

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,135 @@ +//===--- UseStdMinMaxCheck.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

[llvm] [clang] [clang-tools-extra] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [lld] [libcxx] [openmp] [llvm] [clang-tools-extra] [flang] [clang] [mlir] [libc] [lldb] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Hristo Hristov via cfe-commits
H-G-Hristov wrote: @mordante Could you please have another look at the test/latest update. https://github.com/llvm/llvm-project/pull/76449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/7] [clang][modules] Print library module manifest path. This i

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Björn Schäpers via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void f()

[clang-tools-extra] [llvm] [clang] Add clang-tidy check to suggest replacement of conditional statement with std::min/std::max (PR #77816)

2024-01-20 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti edited https://github.com/llvm/llvm-project/pull/77816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libc] [flang] [mlir] [libcxx] [lldb] [clang-tools-extra] [openmp] [clang] [llvm] [lld] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/76447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [lld] [libcxx] [openmp] [llvm] [clang-tools-extra] [flang] [clang] [mlir] [libc] [lldb] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante approved this pull request. Still LGTM! https://github.com/llvm/llvm-project/pull/76449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] NEVER allow && to be an unary operator. (PR #78852)

2024-01-20 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: Never knew that, and I'm sad I do now... But based on the documentation one could just check the previous token to be one of `={,-+(`. https://github.com/llvm/llvm-project/pull/78852 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. Sorry, seems I've missed this change. https://github.com/llvm/llvm-project/pull/77868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [clang-tidy] Ignore user-defined literals in google-runtime-int (PR #78859)

2024-01-20 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 created https://github.com/llvm/llvm-project/pull/78859 User-defined literals do not accept u?intXX(_t)? variables. So the check should not emit a warning. Fixes #54546 #25214 From 8ea205ae2324d67f9adaf30d5662d2cde2096534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=

[clang-tools-extra] [clang-tidy] Ignore user-defined literals in google-runtime-int (PR #78859)

2024-01-20 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Félix-Antoine Constantin (felix642) Changes User-defined literals do not accept u?intXX(_t)? variables. So the check should not emit a warning. Fixes #54546 #25214 --- Full diff: https://github.com/llvm/llvm-project/pull/78859.diff

[lld] [flang] [libcxx] [compiler-rt] [libc] [clang] [lldb] [clang-tools-extra] [llvm] [lld-macho] Find objects in library search path (PR #78628)

2024-01-20 Thread via cfe-commits
https://github.com/OldWorldOrdr updated https://github.com/llvm/llvm-project/pull/78628 >From e73fc2d0263e9e601f2964a90cfe347e8d2bb87c Mon Sep 17 00:00:00 2001 From: OldWorldOrdr Date: Thu, 18 Jan 2024 16:20:52 -0500 Subject: [PATCH 1/5] [lld-macho] Find objects in library search path --- lld

[clang] [clang-format] Add MainIncludeChar option. (PR #78752)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -0,0 +1,27 @@ +// Test the combination of regrouped include directives, via regexes and owenca wrote: > Ok I will move them there, thanks :) Should I remove these lit tests or are > they complementary? Please remove them from the lit tests. https://github.c

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -1366,11 +1366,12 @@ void WhitespaceManager::alignArrayInitializersLeftJustified( auto &Cells = CellDescs.Cells; // Now go through and fixup the spaces. auto *CellIter = Cells.begin(); - // The first cell needs to be against the left brace. - if (Changes[CellIter->I

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread via cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77868 >From 9f705be37183ca030e7720707f75ffbf9feb670a Mon Sep 17 00:00:00 2001 From: XDeme Date: Fri, 12 Jan 2024 00:18:56 -0300 Subject: [PATCH 1/2] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` Fixes

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-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 093e6bdd4bec8ce9b3baf1e8e0a07aa6549dd5d4 a0eec9816b91057bb15a7e3fb403e655b563d3e2 --

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread via cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77868 >From 9f705be37183ca030e7720707f75ffbf9feb670a Mon Sep 17 00:00:00 2001 From: XDeme Date: Fri, 12 Jan 2024 00:18:56 -0300 Subject: [PATCH 1/3] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` Fixes

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/77868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2fc2ee1 - [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (#77868)

2024-01-20 Thread via cfe-commits
Author: XDeme Date: 2024-01-20T13:34:37-08:00 New Revision: 2fc2ee136c0183f40af4c0e7a8d27092b8ce3415 URL: https://github.com/llvm/llvm-project/commit/2fc2ee136c0183f40af4c0e7a8d27092b8ce3415 DIFF: https://github.com/llvm/llvm-project/commit/2fc2ee136c0183f40af4c0e7a8d27092b8ce3415.diff LOG: [c

[clang] [clang-format] Fix poor spacing in `AlignArrayOfStructures: Left` (PR #77868)

2024-01-20 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [clang] [flang] [libc] [lldb] [libcxx] [clang-tools-extra] [llvm] [lld] [lld-macho] Find objects in library search path (PR #78628)

2024-01-20 Thread Vincent Lee via cfe-commits
https://github.com/thevinster closed https://github.com/llvm/llvm-project/pull/78628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore user-defined literals in google-runtime-int (PR #78859)

2024-01-20 Thread Piotr Zegar via cfe-commits
@@ -359,6 +359,9 @@ Changes in existing checks to ignore unused parameters when they are marked as unused and parameters of deleted functions and constructors. +- Improved :doc:`google-runtime-int` check to ignore + false positives on user defined-literals. --

[clang-tools-extra] [clang-tidy] Ignore user-defined literals in google-runtime-int (PR #78859)

2024-01-20 Thread Piotr Zegar via cfe-commits
@@ -56,11 +56,14 @@ void IntegerTypesCheck::registerMatchers(MatchFinder *Finder) { // http://google.github.io/styleguide/cppguide.html#64-bit_Portability // "Where possible, avoid passing arguments of types specified by // bitwidth typedefs to printf-based APIs." - Fin

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -14583,9 +14583,10 @@ TEST_F(FormatTest, UnderstandContextOfRecordTypeKeywords) { verifyFormat("template <> struct X < 15, i<3 && 42 < 50 && 33 < 28> {};"); verifyFormat("int i = SomeFunction(a b);"); - // FIXME: - // This now gets parsed incorrectly as class definit

[clang-tools-extra] [clang] [llvm] [libcxx] [libc++][hardening] Classify assertions related to leaks and syscalls. (PR #77164)

2024-01-20 Thread Konstantin Varlamov via cfe-commits
https://github.com/var-const updated https://github.com/llvm/llvm-project/pull/77164 >From e28e7b3e1337cb960cdc8028a70a43740fa7d636 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Thu, 21 Dec 2023 14:36:47 -0800 Subject: [PATCH 1/4] [libc++][hardening] Classify assertions related to le

[clang] [clang-format] Add SpacesInParensOption for attributes and filtering for repeated parens (PR #77522)

2024-01-20 Thread Owen Pan via cfe-commits
owenca wrote: > Covering all double parens in a single sub-option is not precise enough for > code bases that may want to have `__attribute__(( x ))` but also allow `if ( > ( x ) )`. We should not go overboard with supporting all kinds of options/suboptions imaginable. I don't think we should

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread via cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77013 >From 45d01cbc7ec958518b1739daa9e9b0dc35c2d194 Mon Sep 17 00:00:00 2001 From: XDeme Date: Thu, 4 Jan 2024 19:04:21 -0300 Subject: [PATCH 1/7] [clang-format] Handle templated elaborated type specifier in function re

[clang] 84cb8ea - [Sema] Use llvm::is_contained (NFC)

2024-01-20 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2024-01-20T14:30:30-08:00 New Revision: 84cb8eaeeb108234be1c8498688a014b87fd431d URL: https://github.com/llvm/llvm-project/commit/84cb8eaeeb108234be1c8498688a014b87fd431d DIFF: https://github.com/llvm/llvm-project/commit/84cb8eaeeb108234be1c8498688a014b87fd431d.diff L

[clang] 8511436 - [Frontend] Use SmallString::operator std::string (NFC)

2024-01-20 Thread Kazu Hirata via cfe-commits
Author: Kazu Hirata Date: 2024-01-20T14:30:36-08:00 New Revision: 851143608e2394487d849f56ea1d4b3d3d8f2ead URL: https://github.com/llvm/llvm-project/commit/851143608e2394487d849f56ea1d4b3d3d8f2ead DIFF: https://github.com/llvm/llvm-project/commit/851143608e2394487d849f56ea1d4b3d3d8f2ead.diff L

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -768,15 +768,25 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // parenthesis by disallowing any further line breaks if there is no line // break after the opening parenthesis. Don't break if it doesn't conserve // columns. + const

[clang] [clang-format]: Fix formatting of if statements with BlockIndent (PR #77699)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -768,15 +768,25 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // parenthesis by disallowing any further line breaks if there is no line // break after the opening parenthesis. Don't break if it doesn't conserve // columns. + const

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
@@ -3873,6 +3873,9 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) { const FormatToken &InitialToken = *FormatTok; nextToken(); + auto IsNonMacroIdentifier = [](FormatToken *Tok) { owenca wrote: Nit: ```suggestion auto IsNonMacroIdentifier =

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread via cfe-commits
https://github.com/XDeme updated https://github.com/llvm/llvm-project/pull/77013 >From 45d01cbc7ec958518b1739daa9e9b0dc35c2d194 Mon Sep 17 00:00:00 2001 From: XDeme Date: Thu, 4 Jan 2024 19:04:21 -0300 Subject: [PATCH 1/8] [clang-format] Handle templated elaborated type specifier in function re

[clang] a464e05 - [clang-format] Handle templated elaborated type specifier in function… (#77013)

2024-01-20 Thread via cfe-commits
Author: XDeme Date: 2024-01-20T14:47:58-08:00 New Revision: a464e05109088f1f3a0ca4c83d6dd900e83bdb4b URL: https://github.com/llvm/llvm-project/commit/a464e05109088f1f3a0ca4c83d6dd900e83bdb4b DIFF: https://github.com/llvm/llvm-project/commit/a464e05109088f1f3a0ca4c83d6dd900e83bdb4b.diff LOG: [c

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-20 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [CLANG] Fix : More Detailed "No expected directives found" (PR #78338)

2024-01-20 Thread Shourya Goel via cfe-commits
Sh0g0-1758 wrote: gentle ping @tbaederr . https://github.com/llvm/llvm-project/pull/78338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Correct lowering of `fp128` intrinsics (PR #76558)

2024-01-20 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/76558 >From e869ad1bc601d95b6364dc5619e79a06e8b0fc82 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 11 Aug 2023 22:16:01 -0400 Subject: [PATCH 1/5] [IR] Add an xpassing test for `f128` intrinsic lowering `f12

<    1   2   3   >