[clang] [Clang][HIP] Target-dependent overload resolution in declarators and specifiers (PR #103031)

2024-08-26 Thread Fabian Ritter via cfe-commits
ritter-x2a wrote: Ping. https://github.com/llvm/llvm-project/pull/103031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #105479)

2024-08-26 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovichtec updated https://github.com/llvm/llvm-project/pull/105479 From 9a9169fa0dcdef2d5af6307f8ff4883cf4fe86d6 Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 5 Apr 2024 15:20:37 +0200 Subject: [PATCH] [clang] Catch missing format attribute

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-26 Thread Tobias Hieta via cfe-commits
tru wrote: This was suggested in https://github.com/llvm/llvm-project/pull/91856 and the suggestion there was that we need to split it up per sub-project which is something @e-kwsm has been doing: https://github.com/llvm/llvm-project/pulls/e-kwsm so I don't think this one is needed. https://

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-08-26 Thread via cfe-commits
https://github.com/s-watanabe314 edited https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix misalignments of pointers in angle brackets (PR #106013)

2024-08-26 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106013 >From a880299cd884d064e2bd03af308afa52736fa75d Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 25 Aug 2024 14:30:32 -0700 Subject: [PATCH 1/2] [clang-format] Fix misalignments of pointers in angle brackets F

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Utkarsh Saxena via cfe-commits
@@ -461,15 +457,15 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, I != N; ++I) { if (CheckCoroCall || Callee->getParamDecl(I)->hasAttr()) VisitLifetimeBoundArg(Callee->getParamDecl(I), Args[I]); -else if (EnableLifetimeWarni

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Utkarsh Saxena via cfe-commits
@@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, // Once we initialized a value with a reference, it can no longer dangle. if (!Value) { for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) { -if (PE.

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

2024-08-26 Thread Kareem Ergawy via cfe-commits
ergawy wrote: Ping! @banach-space did you manage to take another look? Please let me know if you disagree with my reply above or have further comments. 🙏 https://github.com/llvm/llvm-project/pull/104664 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

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

2024-08-26 Thread Kareem Ergawy via cfe-commits
https://github.com/ergawy updated https://github.com/llvm/llvm-project/pull/104664 >From 714a4308272134fc83f1640f9303fc535a42cfd3 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][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-26 Thread via cfe-commits
cor3ntin wrote: @sdkrystian do you plan to add more tests? https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + const StringRef Name = II->getName(); + + if

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto created https://github.com/llvm/llvm-project/pull/106048 Make sure code respects the GNU-extension __attribute__((returns_nonnull)). Extend the NullabilityChecker to check that a function returns_nonnull does not return a nullptr. CPP-4741 >From 2618fc762a4913eaf3dd3

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Arseniy Zaostrovnykh (necto) Changes Make sure code respects the GNU-extension __attribute__((returns_nonnull)). Extend the NullabilityChecker to check that a function returns_nonnull does not return a nullptr. CPP-4741

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto edited https://github.com/llvm/llvm-project/pull/106048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Does it makes sense to also support function templates? For example, my > understanding is that specializing `is_pointer_interconvertible_with_class()` > would be UB I can't find anything explicit about function template specializations, so I'm not 100% sure whether it's a

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

2024-08-26 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Apologies for the delay, I am OOO 😅 I've had another look and I think that I better understand what the issue is. It is important to distinguish two input types that we are dealing with here: * `-x f95-cpp-input` - Fortran input _before_ pre-processing, * `-x f95` - Fortran

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -461,15 +457,15 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, I != N; ++I) { if (CheckCoroCall || Callee->getParamDecl(I)->hasAttr()) VisitLifetimeBoundArg(Callee->getParamDecl(I), Args[I]); -else if (EnableLifetimeWarni

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/106054 Fixes #105900 >From 2d3b50688e7b0faea4452860cacc24a596cd685c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 26 Aug 2024 10:48:34 +0200 Subject: [PATCH] [Clang] Evaluate dependent indexes of pack inde

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes Fixes #105900 --- Full diff: https://github.com/llvm/llvm-project/pull/106054.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified) clang/lib/Sema/TreeTransform.h (+17-6) - (modi

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/105884 >From 82069c8eb2c31734ce149b510317cded04b3835e Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Aug 2024 21:42:20 +0200 Subject: [PATCH 1/2] [clang] Remove the EnableLifetimeWarnings flag in lifetime anal

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
@@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, // Once we initialized a value with a reference, it can no longer dangle. if (!Value) { for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) { -if (PE.

[clang] [Clang] Correctly finds subexpressions of immediate invocations (PR #106055)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/106055 We were not correctly ignoring implicit casts. Fixes #105558 >From 33ff4f03257c9af03192b92cbd425b731e0f238c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 26 Aug 2024 12:28:07 +0200 Subject: [PATCH]

[clang] [Clang] Correctly finds subexpressions of immediate invocations (PR #106055)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes We were not correctly ignoring implicit casts. Fixes #105558 --- Full diff: https://github.com/llvm/llvm-project/pull/106055.diff 4 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified)

[clang] [analyzer][NFC] Add tests for and refactor StackAddrEscapeChecker 1/3 (PR #105652)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105652 >From db68dcfba96bfbf9367ba4159b6bf179c8c56f4f Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:26:38 +0200 Subject: [PATCH] [analyzer] [NFC] Add tests for and refactor StackAddrEscap

[clang] [Clang][Sema] Revisit the fix for the lambda within a type alias template decl (PR #89934)

2024-08-26 Thread via cfe-commits
cor3ntin wrote: can you Add the https://github.com/llvm/llvm-project/issues/105885 test? Thanks https://github.com/llvm/llvm-project/pull/89934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,3 @@ +// RUN: %clang_cc1 -std=c++20 -fms-extensions %s +// expected-no-diagnostics +constexpr int x = []{ __noop; return 0; }(); cor3ntin wrote: Can you move this test to test/SemaCXX/builtins.cpp ? thanks! https://github.com/llvm/llvm-project/pull/10

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Utkarsh Saxena via cfe-commits
@@ -408,7 +405,8 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call, // Once we initialized a value with a reference, it can no longer dangle. if (!Value) { for (const IndirectLocalPathEntry &PE : llvm::reverse(Path)) { -if (PE.

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 approved this pull request. https://github.com/llvm/llvm-project/pull/105884 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-26 Thread Qiu Chaofan via cfe-commits
ecnelises wrote: Could you pick the test change from https://github.com/ecnelises/llvm-project/commit/9dcb9c96d565f282ca716693b37c65674c3f7edd into this patch? https://github.com/llvm/llvm-project/pull/106012 ___ cfe-commits mailing list cfe-commits@

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Donát Nagy via cfe-commits
NagyDonat wrote: Please ping me when this commit is in a clean state that can be reviewed (e.g. updates on earlier commits are incorporated). Thanks! https://github.com/llvm/llvm-project/pull/105648 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [Clang] Correctly finds subexpressions of immediate invocations (PR #106055)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/106055 >From 33ff4f03257c9af03192b92cbd425b731e0f238c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 26 Aug 2024 12:28:07 +0200 Subject: [PATCH 1/2] [Clang] Correctly finds subexpressions of immediate invoc

[clang] f80c248 - [analyzer][NFC] Add tests for and refactor StackAddrEscapeChecker 1/3 (#105652)

2024-08-26 Thread via cfe-commits
Author: Arseniy Zaostrovnykh Date: 2024-08-26T13:20:33+02:00 New Revision: f80c248a2f26ae80c931eb6dfdec0aea533de537 URL: https://github.com/llvm/llvm-project/commit/f80c248a2f26ae80c931eb6dfdec0aea533de537 DIFF: https://github.com/llvm/llvm-project/commit/f80c248a2f26ae80c931eb6dfdec0aea533de53

[clang] [analyzer][NFC] Add tests for and refactor StackAddrEscapeChecker 1/3 (PR #105652)

2024-08-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/105652 ___ 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 new check bugprone-tagged-union-member-count (PR #89925)

2024-08-26 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-08-26 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-08-26 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-26 Thread Alex Rønne Petersen via cfe-commits
https://github.com/alexrp updated https://github.com/llvm/llvm-project/pull/106012 From 885a1830bf62e4b928fba65b78d5df9e416cb1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 25 Aug 2024 22:47:37 +0200 Subject: [PATCH] [clang][Driver] Define soft float macro

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-26 Thread Alex Rønne Petersen via cfe-commits
alexrp wrote: @ecnelises done, thank you! https://github.com/llvm/llvm-project/pull/106012 ___ 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 new check bugprone-tagged-union-member-count (PR #89925)

2024-08-26 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105653 >From 902e1d63b436db3ca9e21b022e821a0182bf992c Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:53:25 +0200 Subject: [PATCH] [analyzer] Detect leak of a stack address through output a

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105653 >From 902e1d63b436db3ca9e21b022e821a0182bf992c Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:53:25 +0200 Subject: [PATCH] [analyzer] Detect leak of a stack address through output a

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto ready_for_review https://github.com/llvm/llvm-project/pull/105653 ___ 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 new check bugprone-tagged-union-member-count (PR #89925)

2024-08-26 Thread via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/97308 >From e6ee9bef17ca8c597f816661f5bdf16eb5a6a982 Mon Sep 17 00:00:00 2001 From: yronglin Date: Wed, 7 Aug 2024 22:55:40 +0800 Subject: [PATCH 1/3] Reapply "[Clang][CWG1815] Support lifetime extension of temporary

[clang-tools-extra] [wip] Clang tidy/bugprone suspicious pointer arithmetics (PR #106061)

2024-08-26 Thread Zoltán Porkoláb via cfe-commits
https://github.com/zporky created https://github.com/llvm/llvm-project/pull/106061 None From 0202caa773928bfc395b850f52191ab15afe0eb4 Mon Sep 17 00:00:00 2001 From: zporky Date: Thu, 26 Oct 2023 20:40:39 +0200 Subject: [PATCH 1/6] Initial pointer arithmetics using sizeof matcher --- .../bugp

[clang-tools-extra] [wip] Clang tidy/bugprone suspicious pointer arithmetics (PR #106061)

2024-08-26 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] [wip] Clang tidy/bugprone suspicious pointer arithmetics (PR #106061)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Zoltán Porkoláb (zporky) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/106061.diff 5 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp (+3) - (modified) clang-tools-extra

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/97308 >From e6ee9bef17ca8c597f816661f5bdf16eb5a6a982 Mon Sep 17 00:00:00 2001 From: yronglin Date: Wed, 7 Aug 2024 22:55:40 +0800 Subject: [PATCH 1/4] Reapply "[Clang][CWG1815] Support lifetime extension of temporary

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
@@ -10705,7 +10705,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/1815.html";>1815 CD4 Lifetime extension in aggregate initialization -No +Clang 19 yronglin wrote: Done https://github.com/llvm/llvm-pro

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
@@ -5567,19 +5568,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/105996 >From 0e4c511107f76da085a8019cf2eca78c3a5a0754 Mon Sep 17 00:00:00 2001 From: yronglin Date: Mon, 26 Aug 2024 02:09:31 +0800 Subject: [PATCH 1/3] [Clang][Interp] Implement constexpr vector unary operators +, -

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -139,6 +139,7 @@ class Compiler : public ConstStmtVisitor, bool>, bool VisitGNUNullExpr(const GNUNullExpr *E); bool VisitCXXThisExpr(const CXXThisExpr *E); bool VisitUnaryOperator(const UnaryOperator *E); + bool VisitVectorUnaryOp(const UnaryOperator *E); ---

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/106054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/106054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread Younan Zhang via cfe-commits
@@ -231,3 +231,30 @@ struct type_info { namespace GH93650 { auto func(auto... inputArgs) { return typeid(inputArgs...[0]); } } // namespace GH93650 + + +namespace GH105900 { + +template +struct types { +template +static constexpr __SIZE_TYPE__ get_index() { return id

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -5312,6 +5314,149 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread via cfe-commits
@@ -0,0 +1,88 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify yronglin wrote: Added. https://github.com/llvm/llvm-project/pull/105996 ___

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
@@ -5567,19 +5568,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/97308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-08-26 Thread via cfe-commits
yronglin wrote: Thanks a lot for your review! https://github.com/llvm/llvm-project/pull/97308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Define soft float macros for PPC. (PR #106012)

2024-08-26 Thread Qiu Chaofan via cfe-commits
https://github.com/ecnelises approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/106012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105648 >From 902e1d63b436db3ca9e21b022e821a0182bf992c Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 10:53:25 +0200 Subject: [PATCH 1/2] [analyzer] Detect leak of a stack address through outpu

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/105884 >From 0f8a051930491b33181bfc4e27320f0a6f31786c Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Aug 2024 21:42:20 +0200 Subject: [PATCH 1/3] [clang] Remove the EnableLifetimeWarnings flag in lifetime anal

[clang] [clang] Remove the EnableLifetimeWarnings flag in lifetime analysis. (PR #105884)

2024-08-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/105884 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Tulio Magno Quites Machado Filho via cfe-commits
tuliom wrote: > Is there an out-of-tree scenario where CLANG_RESOURCE_DIR needs to be > replaced with something else at runtime, i.e. a real use-case for the > optional CustomResourceDir optional argument I removed? @kimgr I have also looked for this and I haven't found an use-case where this

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: @steakhal I've rebased atop of `main` and squashed. CI is green. Could you, please, merge this PR (following https://github.com/llvm/llvm-project/pull/105652)? https://github.com/llvm/llvm-project/pull/105653 ___ cfe-commits mailing list

[clang] [lldb] Use CLANG_RESOURCE_DIR more consistently (PR #103388)

2024-08-26 Thread Tulio Magno Quites Machado Filho via cfe-commits
tuliom wrote: > Do we need anything more to make progress with this PR? @kimgr Do you have committer permission? Would you like some help to get this merged? https://github.com/llvm/llvm-project/pull/103388 ___ cfe-commits mailing list cfe-commits@li

[clang] 95b37a7 - [analyzer] Detect leak of a stack address through output arguments 2/3 (#105653)

2024-08-26 Thread via cfe-commits
Author: Arseniy Zaostrovnykh Date: 2024-08-26T14:38:54+02:00 New Revision: 95b37a76493a1cd4b607f53f4318b5da5b5392f0 URL: https://github.com/llvm/llvm-project/commit/95b37a76493a1cd4b607f53f4318b5da5b5392f0 DIFF: https://github.com/llvm/llvm-project/commit/95b37a76493a1cd4b607f53f4318b5da5b5392f

[clang] [analyzer] Detect leak of a stack address through output arguments 2/3 (PR #105653)

2024-08-26 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/105653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/105648 >From 991f176c5545fedae2ba8b5c1b357734abe68ac7 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 11:16:10 +0200 Subject: [PATCH] [analyzer] Detect leaks on top-level via output params, in

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto ready_for_review https://github.com/llvm/llvm-project/pull/105648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Detect leaks of stack addresses via output params, indirect globals 3/3 (PR #105648)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
necto wrote: > Please ping me when this commit is in a clean state that can be reviewed > (e.g. updates on earlier commits are incorporated). Thanks! @NagyDonat , the earlier commits are now merged and I rebased this PR. Feel free to have a look https://github.com/llvm/llvm-project/pull/10564

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Arseniy Zaostrovnykh via cfe-commits
https://github.com/necto updated https://github.com/llvm/llvm-project/pull/106048 >From 7d5ae515f7727de98e7e8ce2f259e579a1f24463 Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Tue, 20 Aug 2024 17:31:11 +0200 Subject: [PATCH] [analyzer] Report violations of the "returns_nonnull" attr

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-26 Thread Piyou Chen via cfe-commits
BeMg wrote: ping https://github.com/llvm/llvm-project/pull/85786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 Thread via cfe-commits
https://github.com/whisperity converted_to_draft https://github.com/llvm/llvm-project/pull/106061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [wip][clang-tidy] Add new `bugprone-suspicious-pointer-arithmetics-using-sizeof` (`cert-arr39-c`) check (PR #106061)

2024-08-26 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 7b12d8bf8a1ff1540e32345b045f813644708a71 7e3b35dbf09d99fba55d42d9c4c5c571dd4703a6 --e

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Can you please add more details in your summary about the problem and how the > PR will fix the problem. @shafik I will once I get back to this PR. > @sdkrystian do you plan to add more tests? @cor3ntin I do, I just haven't gotten around to it yet :) https://github.com/llvm

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-26 Thread via cfe-commits
cor3ntin wrote: thanks! the window for a back port to 19 is closing fast fyi! https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][Interp] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/106071 The new constant interpreter's `clang::interp::InterpState` contains both `clang::interp::Context` and `clang::ASTContext`. So using `S.Ctx` and `S.getCtx()` was a bit confusing. This PR rename `getCtx()` to `

[clang] [NFC][Clang][Interp] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes The new constant interpreter's `clang::interp::InterpState` contains both `clang::interp::Context` and `clang::ASTContext`. So using `S.Ctx` and `S.getCtx()` was a bit confusing. This PR rename `getCtx()` to `getAS

[clang] [Clang] Evaluate dependent indexes of pack indexing in a constant context (PR #106054)

2024-08-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/106054 >From 2d3b50688e7b0faea4452860cacc24a596cd685c Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 26 Aug 2024 10:48:34 +0200 Subject: [PATCH 1/2] [Clang] Evaluate dependent indexes of pack indexing in a

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

2024-08-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/105983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

2024-08-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Thank you! LGTM modulo tiny nits. FWIW, the precommit CI failure looks unrelated to your changes, I wouldn't worry about it (the issue hopefully goes away if you rebase). https://github.com/llvm/llvm-project/pull/105983 __

[clang] `__noop` not marked as constexpr #102064 (PR #105983)

2024-08-26 Thread Aaron Ballman via cfe-commits
@@ -861,6 +861,8 @@ Bug Fixes to Compiler Builtins - Clang now allows pointee types of atomic builtin arguments to be complete template types that was not instantiated elsewhere. +- Fix ``__noop`` not marked as constexpr. (#GH102064) AaronBallman wrote: ``

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: Thanks for this improvement, I'm really happy to see this! (I added some inline comments, but they are all minor and tangential.) Right now all the `nullability.*` checkers are marked as (ObjC) in [the documentation](https://clang.llvm.org/docs/analyz

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -10,3 +12,42 @@ void block_arity_mismatch() { void(^b)() = ^(int a, int b) { }; b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}} } + +int *nonnull_return_annotation_indirect() __attribute__((returns_nonnull)); +int *nonnull_retur

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -1,4 +1,6 @@ -// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability -Wno-deprecated-non-prototype -verify %s +// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability,debug.ExprInspection -Wno-deprecated-non-prototype -verify %s ---

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -10,3 +12,42 @@ void block_arity_mismatch() { void(^b)() = ^(int a, int b) { }; b(1); // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}} } + +int *nonnull_return_annotation_indirect() __attribute__((returns_nonnull)); +int *nonnull_retur

[clang] [analyzer] Report violations of the "returns_nonnull" attribute (PR #106048)

2024-08-26 Thread Donát Nagy via cfe-commits
@@ -692,6 +692,14 @@ void NullabilityChecker::checkPreStmt(const ReturnStmt *S, NullConstraint Nullness = getNullConstraint(*RetSVal, State); Nullability RequiredNullability = getNullabilityAnnotation(RequiredRetType); + if (const auto *FunDecl = C.getLocationContext()->g

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -5312,6 +5314,147 @@ bool Compiler::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template +bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); +

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

2024-08-26 Thread Timm Baeder via cfe-commits
@@ -0,0 +1,89 @@ +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -Wno-uninitialized -std=c++14 -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter -Wno-uninitialized -std=c++14 -fsyntax-only -verify + +// expected-no-dia

[clang] [NFC][Clang][Interp] Rename `clang::interp::State::getCtx` to `clang::interp::State::getASTContext` (PR #106071)

2024-08-26 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr approved this pull request. LGTM if the CI comes back green, but we use "[clang][bytecode]" (all lowercase) in the commit message now. https://github.com/llvm/llvm-project/pull/106071 ___ cfe-commits mailing list cfe-commit

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-26 Thread Kito Cheng via cfe-commits
@@ -2877,10 +2877,143 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

<    1   2   3   4   5   >