[clang] [clang][bytecode] Fix shifting negative values (PR #104663)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: This code is unused unless you're passing `-fexperimental-new-constant-interpreter`, is anyone using that in production code? https://github.com/llvm/llvm-project/pull/104663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @cor3ntin Do you mean casting to `void` or declaring a `void` function? https://github.com/llvm/llvm-project/pull/104677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread via cfe-commits
cor3ntin wrote: Casting to void https://github.com/llvm/llvm-project/pull/104677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread via cfe-commits
@@ -54,3 +54,9 @@ void test_missiles(void) { launch_missiles(); } +[[nodiscard]] int f3(); + +void f4() { cor3ntin wrote: ```suggestion void GH104391(void) { ``` https://github.com/llvm/llvm-project/pull/104677 _

[clang] [clang][bytecode] Support ObjC blocks (PR #104551)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr edited https://github.com/llvm/llvm-project/pull/104551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/104677 >From cd7ce740464c9c46ab231cf773fd1cf28e3495eb Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 17 Aug 2024 19:43:45 +0300 Subject: [PATCH 1/2] [Clang] warn on discarded [[nodiscard]] function results a

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread Oleksandr T. via cfe-commits
@@ -54,3 +54,9 @@ void test_missiles(void) { launch_missiles(); } +[[nodiscard]] int f3(); + +void f4() { a-tarasyuk wrote: @cor3ntin I've updated the test. Thanks for the review. https://github.com/llvm/llvm-project/pull/104677 ___

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/104677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check constraints for an explicit instantiation of a member function (PR #104438)

2024-08-18 Thread Mital Ashok via cfe-commits
@@ -5663,6 +5663,8 @@ def err_explicit_instantiation_internal_linkage : Error< def err_explicit_instantiation_not_known : Error< "explicit instantiation of %0 does not refer to a function template, " "variable template, member function, member class, or static data member">

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/96113 >From 453fea9fee85aef61c449761f24b0accecf03d29 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 19 Jun 2024 21:03:34 +0100 Subject: [PATCH 1/2] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/94118 >From ed1c00ee4474a626965290f2d16aaaf0f4519ec9 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 1 Jun 2024 17:45:21 +0100 Subject: [PATCH 1/5] constexpr __builtin_signbit --- clang/include/clang/Basic/B

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. We have explicitly said in the other PR that we do *not* want checks to depend on each other. Checks must remain independent of each other. https://github.com/llvm/llvm-project/pull/104694 _

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/104694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp edited https://github.com/llvm/llvm-project/pull/104694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread via cfe-commits
https://github.com/c8ef closed https://github.com/llvm/llvm-project/pull/104694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread via cfe-commits
c8ef wrote: I apologize for not noticing this earlier. https://github.com/llvm/llvm-project/pull/104694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Endilll This should be done, just needs to be merged https://github.com/llvm/llvm-project/pull/94118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Consider `readability-uppercase-literal-suffix` when dealing with `readability-implicit-bool-conversion`. (PR #104694)

2024-08-18 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: No problem, thanks for the initiative! We should probably clarify this in the developer documentation. https://github.com/llvm/llvm-project/pull/104694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] 1125934 - [Clang] `constexpr` builtin floating point classification / comparison functions (#94118)

2024-08-18 Thread via cfe-commits
Author: Mital Ashok Date: 2024-08-18T13:50:42+04:00 New Revision: 11259343593043c77678b59d420159fcd147a858 URL: https://github.com/llvm/llvm-project/commit/11259343593043c77678b59d420159fcd147a858 DIFF: https://github.com/llvm/llvm-project/commit/11259343593043c77678b59d420159fcd147a858.diff L

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/94118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread Oleksandr T. via cfe-commits
@@ -54,3 +54,9 @@ void test_missiles(void) { launch_missiles(); } +[[nodiscard]] int f3(); + +void f4() { a-tarasyuk wrote: @cor3ntin could you merge it once the CI passes? Thanks https://github.com/llvm/llvm-project/pull/104677 ___

[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @davidstone Do you plan to get back to this PR? https://github.com/llvm/llvm-project/pull/93493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/104687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check constraints for an explicit instantiation of a member function (PR #104438)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/104438 >From e3f210f4105d9eef5f34af893b5af81ac94e250b Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Thu, 15 Aug 2024 15:46:43 +0200 Subject: [PATCH 1/2] [Clang] Check constraints for an explicit instantiation o

[clang] [Clang] Check constraints for an explicit instantiation of a member function (PR #104438)

2024-08-18 Thread via cfe-commits
@@ -5663,6 +5663,8 @@ def err_explicit_instantiation_internal_linkage : Error< def err_explicit_instantiation_not_known : Error< "explicit instantiation of %0 does not refer to a function template, " "variable template, member function, member class, or static data member">

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread Younan Zhang via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread Younan Zhang via cfe-commits
@@ -1122,6 +1122,154 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( PointOfInstantiation, Satisfaction); } +namespace { + +// We employ a TreeTransform because RAV couldn't recurse into a bunch of +// Exprs e.g. SizeOfPackExpr,

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-fast` running on `sanitizer-buildbot4` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/2272 Here is the relevant piece of

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/102857 >From 1119f0a8d180e482bff45c999d488827ac5ae49e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 12 Aug 2024 23:32:34 +0800 Subject: [PATCH 01/10] [Clang][NFCI] Slightly refactor getTemplateInstantiationAr

[clang] [clang-tools-extra] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

2024-08-18 Thread via cfe-commits
cor3ntin wrote: While I agree with you that we should be careful with you that `const_cast` is usually a bad thing, I am not sure removing const everywhere for one usage is a net-positive. There are no reason for template arguments to ever be modified. The forgot/remember exception is somewhat

[clang] c4092d3 - [Clang] warn on discarded [[nodiscard]] function results after casting in C (#104677)

2024-08-18 Thread via cfe-commits
Author: Oleksandr T. Date: 2024-08-18T12:45:20+02:00 New Revision: c4092d326ae4989f54c5f01d3a077841fd76bc2f URL: https://github.com/llvm/llvm-project/commit/c4092d326ae4989f54c5f01d3a077841fd76bc2f DIFF: https://github.com/llvm/llvm-project/commit/c4092d326ae4989f54c5f01d3a077841fd76bc2f.diff

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/104677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-08-18 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 d990cc4568f45c28d1d5ac86125935628c76efc8 cebe7063174a12dfedbe28185b7173b8826093ab --e

[clang] 7180170 - [clang][test] Remove bytecode interpreter RUN line from test

2024-08-18 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-08-18T13:02:37+02:00 New Revision: 71801707e33c235656b172fa7dfb8662473a95c2 URL: https://github.com/llvm/llvm-project/commit/71801707e33c235656b172fa7dfb8662473a95c2 DIFF: https://github.com/llvm/llvm-project/commit/71801707e33c235656b172fa7dfb8662473a95c2.diff LO

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-18 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/99646 >From 6312ad5d7fa63bda97d534fe76967a69e019cded Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Fri, 19 Jul 2024 15:47:57 +0300 Subject: [PATCH 1/7] [NVPTX] Support __usAtomicCAS builtin --- clang/include/

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-18 Thread via cfe-commits
https://github.com/DenisGZM updated https://github.com/llvm/llvm-project/pull/99646 >From accdc9bee5a6f2ee2add330dd8d06d280cd13b64 Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Fri, 19 Jul 2024 15:47:57 +0300 Subject: [PATCH 1/7] [NVPTX] Support __usAtomicCAS builtin --- clang/include/

[clang] [clang-tools-extra] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/104687 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/104666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
cor3ntin wrote: @c8ef you need me to merge that for you? https://github.com/llvm/llvm-project/pull/104666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I think the main contribution of this patch is showing the extent of the propagation. I personally was surprised this got to `ASTMatchers` and `APValue`. Now that we understand the scope, we can try to draw a line where changes here stop making sense, and do some else where we'd

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-18 Thread via cfe-commits
@@ -0,0 +1,37 @@ +; RUN: llc < %s -march=nvptx64 -mcpu=sm_32 | FileCheck %s --check-prefixes=SM30,CHECK DenisGZM wrote: Seems, that noone autogenerated tests for ptx before, because there wasn't nvptx march https://github.com/llvm/llvm-project/pull/99646 _

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
c8ef wrote: Yes, please. That would be great. https://github.com/llvm/llvm-project/pull/104666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I'll deal with the formatting later, because I don't want to burden reviewers with more changes than necessary. I also updated the description after fixing clang-tidy build. We've got two more bad `const_cast`s. https://github.com/llvm/llvm-project/pull/104687 __

[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)

2024-08-18 Thread via cfe-commits
https://github.com/DenisGZM deleted https://github.com/llvm/llvm-project/pull/99646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-bootstrap-asan` running on `sanitizer-buildbot2` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/1612 Here is the relevant

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot12` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/1360 Here is the rele

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread Sergei Barannikov via cfe-commits
@@ -15567,12 +15567,13 @@ bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { HandleComplexComplexDiv(A, B, C, D, ResR, ResI); } } else { - if (RHS.getComplexIntReal() == 0 && RHS.getComplexIntImag() == 0) -return Error(E, d

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-18 Thread Jan Kokemüller via cfe-commits
https://github.com/jiixyj created https://github.com/llvm/llvm-project/pull/104701 In C, it is a common pattern to have `static inline` functions in headers to avoid ODR issues. Currently, when those headers are included in a GMF, the names are not found when two-phase name lookup and ADL is i

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-modules Author: Jan Kokemüller (jiixyj) Changes In C, it is a common pattern to have `static inline` functions in headers to avoid ODR issues. Currently, when those headers are included in a GMF, the names are not found

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-18 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 dac182990dabe8d15cfb8079aba68df2ded015aa feaf6512fc6323ad0c3d5082c06e610504f0a527 --e

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @tbaederr Thanks for fixing the build bots. The leak appears to be unrelated to these changes and happen on this line: https://github.com/llvm/llvm-project/blob/71801707e33c235656b172fa7dfb8662473a95c2/clang/test/Sema/constant-builtins-2.c#L309 It even happens with: ```c int

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-18 Thread Jan Kokemüller via cfe-commits
https://github.com/jiixyj updated https://github.com/llvm/llvm-project/pull/104701 From feaf6512fc6323ad0c3d5082c06e610504f0a527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kokem=C3=BCller?= Date: Sun, 18 Aug 2024 13:45:43 +0200 Subject: [PATCH 1/2] Expose static inline function from GMF Th

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
https://github.com/c8ef updated https://github.com/llvm/llvm-project/pull/104666 >From b58b9c3ad5fb2b37715ba9f52c905b6961159f0c Mon Sep 17 00:00:00 2001 From: c8ef Date: Sat, 17 Aug 2024 05:42:39 + Subject: [PATCH 1/4] [clang] fix divide by zero in ComplexExprEvaluator --- clang/lib/AST/Ex

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
@@ -15567,12 +15567,13 @@ bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { HandleComplexComplexDiv(A, B, C, D, ResR, ResI); } } else { - if (RHS.getComplexIntReal() == 0 && RHS.getComplexIntImag() == 0) -return Error(E, d

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread Sergei Barannikov via cfe-commits
https://github.com/s-barannikov approved this pull request. https://github.com/llvm/llvm-project/pull/104666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] warn on discarded [[nodiscard]] function results after casting in C (PR #104677)

2024-08-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/104677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: Yeah it's a well known problem. > Is there a different file that these tests should be added for? Like > AST/ByteCode/builtin-functions.cpp? That should work. I have sanitizers enabled locally so I can test the changes if you want. https://github.com/llvm/llvm-project/pull/94

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/104703 See also: #94118, 71801707e33c235656b172fa7dfb8662473a95c2 >From 76735bd57b948dcbd366a80b846be38f0bf8c41e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 18 Aug 2024 14:12:51 +0100 Subject: [PATCH] [C

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes See also: #94118, 71801707e33c235656b172fa7dfb8662473a95c2 --- Full diff: https://github.com/llvm/llvm-project/pull/104703.diff 1 Files Affected: - (modified) clang/test/AST/ByteCode/builtin-functions.c

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @tbaederr I've basically just copied over the tests from the other file. There's no other quad-precision (`__float128`) tests so they were removed. Do these need to be rewritten in a C++ style? (i.e., replace the macros with template functions) https://github.com/llvm/llv

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/104704 https://cplusplus.github.io/CWG/issues/722.html nullptr passed to a variadic function now converted to void* in C++. This does not affect C23 nullptr. Also fixes -Wformat-pedantic so that it no longer warns

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mital Ashok (MitalAshok) Changes https://cplusplus.github.io/CWG/issues/722.html nullptr passed to a variadic function now converted to void* in C++. This does not affect C23 nullptr. Also fixes -Wformat-pedantic so that it no longer war

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This was originally part of https://reviews.llvm.org/D156054 (Previously reviewed by @AaronBallman), but there have been a lot of changes. https://github.com/llvm/llvm-project/pull/104704 ___ cfe-commits mailing list cfe-commits@lis

[clang] [HIP] search fatbin symbols for libs passed by -l (PR #104638)

2024-08-18 Thread Yaxun Liu via cfe-commits
@@ -76,8 +79,75 @@ class HIPUndefinedFatBinSymbols { return GPUBinHandleSymbols; } + // Collect symbols from static libraries specified by -l options. + void processStaticLibraries() { +llvm::SmallVector LibNames; +llvm::SmallVector LibPaths; +llvm::SmallVe

[clang] [HIP] search fatbin symbols for libs passed by -l (PR #104638)

2024-08-18 Thread Yaxun Liu via cfe-commits
@@ -76,8 +79,75 @@ class HIPUndefinedFatBinSymbols { return GPUBinHandleSymbols; } + // Collect symbols from static libraries specified by -l options. + void processStaticLibraries() { +llvm::SmallVector LibNames; +llvm::SmallVector LibPaths; +llvm::SmallVe

[clang] [HIP] search fatbin symbols for libs passed by -l (PR #104638)

2024-08-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/104638 >From 3c281d8cfc99674f2a4de0dfe5e1f02e35e68d6d Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 16 Aug 2024 14:24:08 -0400 Subject: [PATCH] [HIP] search fatbin symbols for libs passed by -l For -fgp

[clang] [flang] [flang][driver] Add pre-processing type to `.i` files (PR #104664)

2024-08-18 Thread Kareem Ergawy via cfe-commits
https://github.com/ergawy updated https://github.com/llvm/llvm-project/pull/104664 >From 88baab5e4f1f37e7238d11aa416b3bc57cf961fe Mon Sep 17 00:00:00 2001 From: ergawy Date: Sat, 17 Aug 2024 00:20:11 -0500 Subject: [PATCH] [flang][driver] Add pre-processing type to `.i` files This diff allows

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Timm Baeder via cfe-commits
tbaederr wrote: > @tbaederr I've basically just copied over the tests from the other file. > There's no other quad-precision (`__float128`) tests so they were removed. Unfortunately that problem also exists with regular floating-point values (provided they heap-allocate memory). > Do these n

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. https://github.com/llvm/llvm-project/pull/104703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/104707 The previous code made this a compile-time decision but it's not. >From ba9edf8e883d9ac976a79c4f8883d71625b6cbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Aug 2024 15:40:05 +02

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes The previous code made this a compile-time decision but it's not. --- Full diff: https://github.com/llvm/llvm-project/pull/104707.diff 4 Files Affected: - (modified) clang/lib/AST/ByteCode/Compiler.cpp (+1

[clang] d082f1f - [clang][bytecode] Only booleans can be inverted

2024-08-18 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-08-18T16:02:32+02:00 New Revision: d082f1f37d8cb7a0c6875537ba873a631b154d53 URL: https://github.com/llvm/llvm-project/commit/d082f1f37d8cb7a0c6875537ba873a631b154d53 DIFF: https://github.com/llvm/llvm-project/commit/d082f1f37d8cb7a0c6875537ba873a631b154d53.diff LO

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -std=c++98 %s -verify -pedantic-errors +// RUN: %clang_cc1 -std=c++11 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++14 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++17 %s -

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/104707 >From 30ea12f3a0841a532471c750204f13e5850d714c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Aug 2024 15:40:05 +0200 Subject: [PATCH] [clang][bytecode] Fix 'if consteval' in non-con

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -std=c++98 %s -verify -pedantic-errors +// RUN: %clang_cc1 -std=c++11 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++14 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++17 %s -

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-18 Thread via cfe-commits
@@ -104,6 +104,14 @@ New check aliases Changes in existing checks ^^ +- Improved :doc:`modernize-use-std-format + ` check to support replacing + member function calls too. + +- Improved :doc:`modernize-use-std-print EugeneZelenko wrot

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-18 Thread via cfe-commits
https://github.com/EugeneZelenko requested changes to this pull request. https://github.com/llvm/llvm-project/pull/104675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-18 Thread via cfe-commits
https://github.com/EugeneZelenko deleted https://github.com/llvm/llvm-project/pull/104675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -std=c++98 %s -verify -pedantic-errors +// RUN: %clang_cc1 -std=c++11 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++14 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++17 %s -

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] [HIP] search fatbin symbols for libs passed by -l (PR #104638)

2024-08-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/104638 >From 6e6bb355f2cf79f30d01c97b580d4354cbb7e727 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 16 Aug 2024 14:24:08 -0400 Subject: [PATCH] [HIP] search fatbin symbols for libs passed by -l For -fgp

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang] e05307f - [clang][OpenMP] Avoid multiple calls to getCurrentDirective in DSAChecker, NFC

2024-08-18 Thread Krzysztof Parzyszek via cfe-commits
Author: Krzysztof Parzyszek Date: 2024-08-18T10:25:52-05:00 New Revision: e05307f6633ca405834a4fd24d858ffb676c9170 URL: https://github.com/llvm/llvm-project/commit/e05307f6633ca405834a4fd24d858ffb676c9170 DIFF: https://github.com/llvm/llvm-project/commit/e05307f6633ca405834a4fd24d858ffb676c9170

[clang] dd40632 - [clang] fix divide by zero in ComplexExprEvaluator (#104666)

2024-08-18 Thread via cfe-commits
Author: c8ef Date: 2024-08-18T17:32:44+02:00 New Revision: dd40632b52d8da2146a12254afc900315ac3c2e4 URL: https://github.com/llvm/llvm-project/commit/dd40632b52d8da2146a12254afc900315ac3c2e4 DIFF: https://github.com/llvm/llvm-project/commit/dd40632b52d8da2146a12254afc900315ac3c2e4.diff LOG: [cl

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/104666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread via cfe-commits
cor3ntin wrote: @MitalAshok should i merge? https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix 'if consteval' in non-constant contexts (PR #104707)

2024-08-18 Thread Timm Baeder via cfe-commits
@@ -4368,8 +4363,19 @@ template bool Compiler::visitIfStmt(const IfStmt *IS) { if (!visitDeclStmt(CondDecl)) return false; - if (!this->visitBool(IS->getCond())) -return false; + // Compile condition. + if (IS->isNonNegatedConsteval()) { +if (!this->emit

[clang-tools-extra] bbcb625 - [clang-tidy] Support member functions with modernize-use-std-print/format (#104675)

2024-08-18 Thread via cfe-commits
Author: Mike Crowe Date: 2024-08-18T17:46:19+02:00 New Revision: bbcb625798514f1cd6ef04818381d38ea26b23e5 URL: https://github.com/llvm/llvm-project/commit/bbcb625798514f1cd6ef04818381d38ea26b23e5 DIFF: https://github.com/llvm/llvm-project/commit/bbcb625798514f1cd6ef04818381d38ea26b23e5.diff LO

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-18 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL closed https://github.com/llvm/llvm-project/pull/104675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] de5ea2d - [clang][OpenMP] Change /* ParamName */ to /*ParamName=*/, NFC

2024-08-18 Thread Krzysztof Parzyszek via cfe-commits
Author: Krzysztof Parzyszek Date: 2024-08-18T10:48:49-05:00 New Revision: de5ea2d122c31e1551654ff506c33df299f351b8 URL: https://github.com/llvm/llvm-project/commit/de5ea2d122c31e1551654ff506c33df299f351b8 DIFF: https://github.com/llvm/llvm-project/commit/de5ea2d122c31e1551654ff506c33df299f351b8

[clang] [llvm] [llvm][clang] Move RewriterBuffer to ADT. (PR #99770)

2024-08-18 Thread Jacques Pienaar via cfe-commits
https://github.com/jpienaar updated https://github.com/llvm/llvm-project/pull/99770 >From ee91900dd42321ce1344a70df5f1baddf36bde9f Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Sat, 20 Jul 2024 16:25:14 + Subject: [PATCH] [llvm][clang] Move RewriterBuffer to ADT. These classes are n

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Yes, thanks https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix typo in SanitizerCoverage.rst (PR #104715)

2024-08-18 Thread Marco Vanotti via cfe-commits
https://github.com/mvanotti created https://github.com/llvm/llvm-project/pull/104715 The callback for indirect calls is `__sanitizer_cov_trace_pc_indir`, not `__sanitizer_cov_trace_pc_indirect`. See: https://github.com/llvm/llvm-project/blob/de5ea2d122c31e1551654ff506c33df299f351b8/compiler-r

  1   2   >