[clang] [llvm] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
Sirraide wrote: You can ignore the merge conflicts in the release notes; it’s better to let whoever ends up merging this (probably me) take care of that when it comes to the release notes (because they get updated constantly). https://github.com/llvm/llvm-project/pull/86122 ___

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
@@ -394,6 +394,8 @@ Bug Fixes to C++ Support expression references to an entity declared outside of the lambda. (#GH64808) - Clang's __builtin_bit_cast will now produce a constant value for records with empty bases. See: (#GH82383) +- Fix an issue where a namespace alias c

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-21 Thread Kees Cook via cfe-commits
kees wrote: Ah, well, regardless, I think I found where the `StructuredList->setInitializedFieldInUnion` was actually missing, and then I could undo my zero-init-only and everything still appears fixed. Doing a full debug build test run now... https://github.com/llvm/llvm-project/pull/84428 _

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
@@ -394,6 +394,8 @@ Bug Fixes to C++ Support expression references to an entity declared outside of the lambda. (#GH64808) - Clang's __builtin_bit_cast will now produce a constant value for records with empty bases. See: (#GH82383) +- Fix an issue where a namespace alias c

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. LGTM except for a minor comment wrt the release note. https://github.com/llvm/llvm-project/pull/86122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
Sirraide wrote: > ``` > test.cpp:4:20: error: namespace alias must be a single identifier > 4 | namespace alias::extra::qualifiers = ::myns; > |^~~ > 1 error generated. > ``` Nice, that is pretty much exactly what I had in mind. https://github.c

[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

2024-03-21 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/86025 >From 9c75bb6dac672fedef114618500cd8600501f8aa Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Wed, 20 Mar 2024 15:50:01 -0700 Subject: [PATCH 1/3] [InstallAPI] Report exports discovered in binary but not

[clang] [clang] Implement __builtin_{clzg,ctzg} (PR #83431)

2024-03-21 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers closed https://github.com/llvm/llvm-project/pull/83431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread via cfe-commits
Sirraide wrote: > I think this is a demonstration of exactly what we _don't_ want to see in the > code base. That's just purely noise IMO. Its seem pretty unnecessary, yeah. I was fine w/ the one in this pr mainly because of the comment; my thinking was that there ought to be a reason why thi

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" again (PR #85791)

2024-03-21 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy , =?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/85791 >From 3fbc8da42726aa63ad0aef7ba12141125197279b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Tue, 19 Mar 2024 14:

[clang] [clang][SPIRV] Don't warn on -mcmodel (PR #86039)

2024-03-21 Thread Arthur Eubanks via cfe-commits
https://github.com/aeubanks edited https://github.com/llvm/llvm-project/pull/86039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add `clang_getCursorCallExprKind` to get the underlying type of CallExpr (PR #86143)

2024-03-21 Thread via cfe-commits
https://github.com/16bit-ykiko updated https://github.com/llvm/llvm-project/pull/86143 >From 32d4fc35f3d52b54e308b76c00c292497afe9621 Mon Sep 17 00:00:00 2001 From: ykiko Date: Fri, 22 Mar 2024 00:00:30 +0800 Subject: [PATCH 1/3] add `clang_getCursorCallExprKind` to get the underlying type of

[clang] [clang] Implement __builtin_{clzg,ctzg} (PR #83431)

2024-03-21 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: @overmighty do you need one of us to commit this for you? Thanks for working on it! https://github.com/llvm/llvm-project/pull/83431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/22]

[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

2024-03-21 Thread Juergen Ributzka via cfe-commits
@@ -520,5 +515,136 @@ void DylibVerifier::VerifierContext::emitDiag( Report(); } +// The existence of weak-defined RTTI can not always be inferred from the +// header files because they can be generated as part of an implementation +// file. +// InstallAPI doesn't warn about

[clang] Add `clang_getCursorCallExprKind` to get the underlying type of CallExpr (PR #86143)

2024-03-21 Thread via cfe-commits
https://github.com/16bit-ykiko updated https://github.com/llvm/llvm-project/pull/86143 >From 32d4fc35f3d52b54e308b76c00c292497afe9621 Mon Sep 17 00:00:00 2001 From: ykiko Date: Fri, 22 Mar 2024 00:00:30 +0800 Subject: [PATCH 1/2] add `clang_getCursorCallExprKind` to get the underlying type of

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Nathan Chancellor via cfe-commits
nathanchance wrote: This seems reasonable to me. From the perspective of the Linux kernel, this seems like it should be a no-op, as we enable `-Wcast-function-type` and disable `-Wcast-function-type-strict` (under a normal build, it is on with `W=1`) explicitly: ``` $ rg 'cast-function-type(-

[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

2024-03-21 Thread Juergen Ributzka via cfe-commits
@@ -520,5 +515,136 @@ void DylibVerifier::VerifierContext::emitDiag( Report(); } +// The existence of weak-defined RTTI can not always be inferred from the +// header files because they can be generated as part of an implementation +// file. +// InstallAPI doesn't warn about

[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

2024-03-21 Thread Juergen Ributzka via cfe-commits
@@ -21,6 +21,9 @@ CHECK-NEXT: CPP.h:5:7: error: declaration has external linkage, but symbol has i CHECK-NEXT: CPP.h:6:7: error: dynamic library symbol '(weak-def) Bar::init()' is weak defined, but its declaration is not CHECK-NEXT: int init(); CHECK-NEXT: ^ +CHECK-NE

[clang] [llvm] [InstallAPI] Report exports discovered in binary but not in interface (PR #86025)

2024-03-21 Thread Juergen Ributzka via cfe-commits
@@ -520,5 +515,136 @@ void DylibVerifier::VerifierContext::emitDiag( Report(); } +// The existence of weak-defined RTTI can not always be inferred from the +// header files because they can be generated as part of an implementation +// file. +// InstallAPI doesn't warn about

[clang] Add `clang_getCursorCallExprKind` to get the underlying type of CallExpr (PR #86143)

2024-03-21 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 f5c90f3000bc75a344bf01bd4e0401e3fb7f9453 36a7389c7c9c9668146a04f66af22e1f7be0dbb7 --

[clang] Add `clang_getCursorCallExprKind` to get the underlying type of CallExpr (PR #86143)

2024-03-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: ykiko (16bit-ykiko) Changes Currently, libclang only has the CursorKind: `CXCursor_CallExpr`. Any class inherited from CallExpr is reported as CallExpr. the core code is [here](https://github.com/llvm/llvm-project/blob/main/clang/tools/l

[clang] Add `clang_getCursorCallExprKind` to get the underlying type of CallExpr (PR #86143)

2024-03-21 Thread via cfe-commits
https://github.com/16bit-ykiko created https://github.com/llvm/llvm-project/pull/86143 Currently, libclang only has the CursorKind: `CXCursor_CallExpr`. Any class inherited from CallExpr is reported as CallExpr. the core code is [here](https://github.com/llvm/llvm-project/blob/main/clang/tool

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" again (PR #85791)

2024-03-21 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: NagyDonat wrote: I'll delay reapplying this commit a bit because I realized that it has minor unintended side effects in MallocChecker. https://github.com/llvm/llvm-project/pull/85791 ___ cfe-commits

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
https://github.com/katzdm updated https://github.com/llvm/llvm-project/pull/86122 >From 319b7d99b4010514a1680ffd99fb0586b5e7221d Mon Sep 17 00:00:00 2001 From: Dan Katz Date: Thu, 21 Mar 2024 09:47:04 -0400 Subject: [PATCH 1/3] Raise an error on namespace aliases with qualified names. Current

[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

2024-03-21 Thread via cfe-commits
goldsteinn wrote: See: https://github.com/llvm/llvm-project/pull/86141 which adds `nneg` flag to IR. Once that gets in I have patches for instcombine,cvp,sccp to do the transform. https://github.com/llvm/llvm-project/pull/82404 ___ cfe-commits mailin

[clang] [llvm] Update documentation and release notes for llvm-profgen COFF support (PR #84864)

2024-03-21 Thread Tim Creech via cfe-commits
tcreech-intel wrote: > please resolve the conflicts. Thanks for the review, @williamweixiao. I've resolved the conflicts in 2312821. https://github.com/llvm/llvm-project/pull/84864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" again (PR #85791)

2024-03-21 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus approved this pull request. Lets hope it works fine this time around :) https://github.com/llvm/llvm-project/pull/85791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
https://github.com/katzdm updated https://github.com/llvm/llvm-project/pull/86122 >From 319b7d99b4010514a1680ffd99fb0586b5e7221d Mon Sep 17 00:00:00 2001 From: Dan Katz Date: Thu, 21 Mar 2024 09:47:04 -0400 Subject: [PATCH 1/2] Raise an error on namespace aliases with qualified names. Current

[clang] [llvm] Update documentation and release notes for llvm-profgen COFF support (PR #84864)

2024-03-21 Thread Tim Creech via cfe-commits
https://github.com/tcreech-intel updated https://github.com/llvm/llvm-project/pull/84864 >From 4dc108d0d290ee5fd6a73c029c051fdb2215d00a Mon Sep 17 00:00:00 2001 From: Tim Creech Date: Mon, 11 Mar 2024 22:35:59 -0400 Subject: [PATCH 1/5] Update documentation and release notes for llvm-profgen C

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
katzdm wrote: @Sirraide Thanks for the quick review! I've applied your feedback. Here is an example error message with the patch applied: ``` test.cpp:4:20: error: namespace alias must be a single identifier 4 | namespace alias::extra::qualifiers = ::myns; |^~~~

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > E.g: > > https://github.com/llvm/llvm-project/blob/50801f1095d33e712c3a51fdeef82569bd09007f/clang/lib/Interpreter/IncrementalParser.cpp#L141-L151 I think this is a demonstration of exactly what we *don't* want to see in the code base. That's just purely noise IMO. https:

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread via cfe-commits
Sirraide wrote: Admittedly, it doesn’t seem to be too common, and most other occurrences of this seem to be in LLVM proper and not in Clang. https://github.com/llvm/llvm-project/pull/85921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread via cfe-commits
Sirraide wrote: > Is this addressing a diagnostic you're seeing in the wild? This shouldn't be > necessary because the `case` statements are adjacent to one another with only > comments/whitespace between them: https://godbolt.org/z/oM7x65hq9 > > (I'd like to understand the motivation better b

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-21 Thread Harald van Dijk via cfe-commits
hvdijk wrote: Flexible array initialization is, roughly, implemented as building a different type in which the flexible array member is replaced by an array of the right size, initializing that, and then pretending it was the original type. It does not surprise me too much that this does not w

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I need to extend the tablegen backend ClangDiagnosticsEmitter with some > > kind of new option to handle this, right? > > Alternatively, you could probably use `DiagnosticsEngine::isIgnored` to check > if the `-Wformat-signedness` is enabled or not, and control whether

[clang] [llvm] [Clang][OpenMP] Port clang codegen code for openmp porject (PR #85795)

2024-03-21 Thread via cfe-commits
https://github.com/TSWorld1314 updated https://github.com/llvm/llvm-project/pull/85795 >From c44d8c1c7986fad6370273aca55e2db99d47387a Mon Sep 17 00:00:00 2001 From: "Harrison,Hao" Date: Tue, 19 Mar 2024 13:18:07 + Subject: [PATCH 1/2] [Clang][OpenMP] Port clang codegen code for GPU First p

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread via cfe-commits
Sirraide wrote: E.g: https://github.com/llvm/llvm-project/blob/50801f1095d33e712c3a51fdeef82569bd09007f/clang/lib/Interpreter/IncrementalParser.cpp#L141-L151 https://github.com/llvm/llvm-project/pull/85921 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Balázs Kéri via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-21 Thread Kees Cook via cfe-commits
kees wrote: > > because we don't yet support non-zero initialization (as described in > > commit > > [5955a0f](https://github.com/llvm/llvm-project/commit/5955a0f9375a8c0b134eeb4a8de5155dcce7c94f)) > > I'm confused. We support non-zero init, and there are tests for non-zero init > in that com

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-21 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/85263 >From fc8c1a24f09c8860269fbdcfb0b285ffd19f427c Mon Sep 17 00:00:00 2001 From: yronglin Date: Fri, 15 Mar 2024 00:48:08 +0800 Subject: [PATCH 01/10] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

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

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-03-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Can you please fix the clang build? Done. https://github.com/llvm/llvm-project/pull/85863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-21 Thread via cfe-commits
@@ -1386,9 +1386,19 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&& std::forward<_Tuple>(__t), typename __make_tuple_indices>>::type{})) +#if _LIBCPP_STD_VER >= 20 template inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mak

[clang] [llvm] Update documentation and release notes for llvm-profgen COFF support (PR #84864)

2024-03-21 Thread Wei Xiao via cfe-commits
williamweixiao wrote: please resolve the conflicts. https://github.com/llvm/llvm-project/pull/84864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Update documentation and release notes for llvm-profgen COFF support (PR #84864)

2024-03-21 Thread Wei Xiao via cfe-commits
https://github.com/williamweixiao approved this pull request. https://github.com/llvm/llvm-project/pull/84864 ___ 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 readability-enum-initial-value (PR #86129)

2024-03-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/86129 >From 4e0845a143a820d4a68ffbdced206654c7593359 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 15 Mar 2024 08:07:47 +0800 Subject: [PATCH 1/2] [clang-tidy] add new check readability-enum-initial-value

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-03-21 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/85863 >From bacdc24af088560a986028824a0ac43e929c2f1b Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 21 Mar 2024 21:10:46 +0800 Subject: [PATCH 1/2] [ValueTracking] Add pre-commit tests. NFC. --- llvm/test/Tr

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Balázs Kéri via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I've put up a PR for review at https://github.com/llvm/llvm-project/pull/86131 https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes We want to add -Wcast-function-type to -Wextra (as done in 1de7e6c8cba27296f3fc16d107822ea0ee856759), but we do not want to add -Wcast-function-type-strict in at the same time (https://lab.llvm.org/bu

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @Abhinkop https://github.com/llvm/llvm-project/pull/86131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/86131 We want to add -Wcast-function-type to -Wextra (as done in 1de7e6c8cba27296f3fc16d107822ea0ee856759), but we do not want to add -Wcast-function-type-strict in at the same time (https://lab.llvm.org/buildbo

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Balázs Kéri via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Balázs Kéri via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Is this addressing a diagnostic you're seeing in the wild? This shouldn't be necessary because the `case` statements are adjacent to one another with only comments/whitespace between them: https://godbolt.org/z/oM7x65hq9 (I'd like to understand the mo

[clang-tools-extra] [clang-tidy] add new check readability-enum-initial-value (PR #86129)

2024-03-21 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 ffe41819e58365dfbe85a22556c0d9d284e746b9 4e0845a143a820d4a68ffbdced206654c7593359 --

[clang-tools-extra] [clang-tidy] add new check readability-enum-initial-value (PR #86129)

2024-03-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Congcong Cai (HerrCai0907) Changes Fixes: #85243. --- Full diff: https://github.com/llvm/llvm-project/pull/86129.diff 9 Files Affected: - (modified) clang-tools-extra/clang-tidy/readability/CMakeLists.txt (+1) - (added) clang-too

[clang-tools-extra] [clang-tidy] add new check readability-enum-initial-value (PR #86129)

2024-03-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/86129 Fixes: #85243. >From 4e0845a143a820d4a68ffbdced206654c7593359 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Fri, 15 Mar 2024 08:07:47 +0800 Subject: [PATCH] [clang-tidy] add new check readability-enum-i

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-03-21 Thread Simon Pilgrim via cfe-commits
Pol Marcet =?utf-8?q?Sard=C3=A0?= , Pol Marcet =?utf-8?q?Sard=C3=A0?= ,Pol M Message-ID: In-Reply-To: RKSimon wrote: @Destroyerrrocket reverse-ping - are you still working on this? https://github.com/llvm/llvm-project/pull/76615 ___ cfe-commits mai

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/85921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)

2024-03-21 Thread YAMAMOTO Takashi via cfe-commits
yamt wrote: > @yamt Given that this PR is not large and we already went through it anyway, > nevermind what I said about rebasing, and please use whatever method you are > convenient with. But just FYI you can do `git merge` to avoid rebasing (I'm > not asking you to do it here; just in case y

[clang] [Sema] Don't drop weak_import from a declaration that follows a declaration directly contained in a linkage-specification (PR #85886)

2024-03-21 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak updated https://github.com/llvm/llvm-project/pull/85886 >From d39667c7e65c10babb478d8f8d54fecb66d90568 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Tue, 19 Mar 2024 15:50:00 -0700 Subject: [PATCH] [Sema] Don't drop weak_import from a declaration that follows

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/86122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Daniel M. Katz (katzdm) Changes Clang's current behavior is to ignore the trailing qualifiers, but the [grammar](https://eel.is/c++draft/namespace.alias#nt:namespace-alias-definition) for `namespace-alias-definition` requires an `identifi

[clang] [clang] Improves -print-library-module-manifest-path. (PR #85943)

2024-03-21 Thread Mark de Wever via cfe-commits
mordante wrote: Thanks! https://github.com/llvm/llvm-project/pull/85943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
@@ -140,6 +140,11 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, SkipUntil(tok::semi); return nullptr; } +if (!ExtraNSs.empty()) { + Diag(IdentLoc, diag::err_unexpected_qualified_namespace_alias); Sirraide

[clang] [clang] Improves -print-library-module-manifest-path. (PR #85943)

2024-03-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante closed https://github.com/llvm/llvm-project/pull/85943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
@@ -268,6 +268,8 @@ def err_expected_semi_after_namespace_name : Error< "expected ';' after namespace name">; def err_unexpected_namespace_attributes_alias : Error< "attributes cannot be specified on namespace alias">; +def err_unexpected_qualified_namespace_alias : Error<

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/86122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
@@ -140,6 +140,11 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, SkipUntil(tok::semi); return nullptr; } +if (!ExtraNSs.empty()) { + Diag(IdentLoc, diag::err_unexpected_qualified_namespace_alias); Sirraide

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. Thanks for contributing! This needs a release note (in `clang/docs/ReleaseNotes.rst`) and some changes to the diagnostics, but other than that it looks fine to me. https://github.com/llvm/llvm-project/pull/86122 __

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread via cfe-commits
@@ -268,6 +268,8 @@ def err_expected_semi_after_namespace_name : Error< "expected ';' after namespace name">; def err_unexpected_namespace_attributes_alias : Error< "attributes cannot be specified on namespace alias">; +def err_unexpected_qualified_namespace_alias : Error<

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 Thread Daniel M. Katz via cfe-commits
https://github.com/katzdm created https://github.com/llvm/llvm-project/pull/86122 Clang's current behavior is to ignore the trailing qualifiers, but the [grammar](https://eel.is/c++draft/namespace.alias#nt:namespace-alias-definition) for `namespace-alias-definition` requires an `identifier` wi

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-21 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/85263 >From fc8c1a24f09c8860269fbdcfb0b285ffd19f427c Mon Sep 17 00:00:00 2001 From: yronglin Date: Fri, 15 Mar 2024 00:48:08 +0800 Subject: [PATCH 1/9] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the e

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-03-21 Thread Xiang Li via cfe-commits
@@ -0,0 +1,258 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bo

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-03-21 Thread Xiang Li via cfe-commits
@@ -0,0 +1,258 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bo

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-03-21 Thread Xiang Li via cfe-commits
@@ -0,0 +1,258 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bo

[clang] 2152094 - [clang] Improves -print-library-module-manifest-path. (#85943)

2024-03-21 Thread via cfe-commits
Author: Mark de Wever Date: 2024-03-21T15:11:45+01:00 New Revision: 2152094a45af98c9ccfef6d5913f38c66ab8b165 URL: https://github.com/llvm/llvm-project/commit/2152094a45af98c9ccfef6d5913f38c66ab8b165 DIFF: https://github.com/llvm/llvm-project/commit/2152094a45af98c9ccfef6d5913f38c66ab8b165.diff

[clang] Raise an error on namespace aliases with qualified names. (PR #86122)

2024-03-21 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] [clang-repl] Factor out CreateJITBuilder() and allow specialization in derived classes (PR #84461)

2024-03-21 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail updated https://github.com/llvm/llvm-project/pull/84461 From fae2f46d25650b8480f9d3135f33a0d6532f43ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Thu, 7 Mar 2024 23:04:22 +0100 Subject: [PATCH] [clang-repl] Add CreateJITBuilder() for

[clang] Disable driver tests on macosx that are currently disabled on darwin (PR #85990)

2024-03-21 Thread Akira Hatanaka via cfe-commits
https://github.com/ahatanak closed https://github.com/llvm/llvm-project/pull/85990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a11d9b4 - Disable driver tests on macosx that are currently disabled on darwin (#85990)

2024-03-21 Thread via cfe-commits
Author: Akira Hatanaka Date: 2024-03-21T07:10:42-07:00 New Revision: a11d9b463966d31ecedb373115abdcca54f704c3 URL: https://github.com/llvm/llvm-project/commit/a11d9b463966d31ecedb373115abdcca54f704c3 DIFF: https://github.com/llvm/llvm-project/commit/a11d9b463966d31ecedb373115abdcca54f704c3.diff

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-21 Thread Mark de Wever via cfe-commits
@@ -1386,9 +1386,19 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&& std::forward<_Tuple>(__t), typename __make_tuple_indices>>::type{})) +#if _LIBCPP_STD_VER >= 20 template inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mak

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Yeah, I was hoping to avoid having to introduce another diagnostic group, but I think that's going to be the best way forward. I've got a patch in progress to add `-Wcast-function-type-mismatch` so we end up with: ``` -Wcast-function-type |- -Wcast-function-type-mismatch |-

[clang] [clang-repl] Factor out CreateJITBuilder() and allow specialization in derived classes (PR #84461)

2024-03-21 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/84461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Fix Value for platforms where unqualified char is unsigned (PR #86118)

2024-03-21 Thread Vassil Vassilev via cfe-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= , Stefan =?utf-8?q?Gr=C3=A4nitz?= Message-ID: In-Reply-To: https://github.com/vgvassilev approved this pull request. Good catch! Thank you, @weliveindetail! https://github.com/llvm/llvm-project/pull/86118 ___ cfe-comm

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Abhin P Jose via cfe-commits
Abhinkop wrote: > > > I'm confused as to how this code ever compiled in the first place... In > > > each case, this is C++ code that's failing: > > > ``` > > > /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common

[clang] [clang-repl] Fix Value for platforms where unqualified char is unsigned (PR #86118)

2024-03-21 Thread via cfe-commits
Stefan =?utf-8?q?Gränitz?= , Stefan =?utf-8?q?Gränitz?= Message-ID: In-Reply-To: llvmbot wrote: @llvm/pr-subscribers-clang Author: Stefan Gränitz (weliveindetail) Changes Signedness of unqualified `char` is unspecified and varies between platforms. This patch adds `Char_U` in `REPL_BUI

[clang] [clang-repl] Fix Value for platforms where unqualified char is unsigned (PR #86118)

2024-03-21 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail created https://github.com/llvm/llvm-project/pull/86118 Signedness of unqualified `char` is unspecified and varies between platforms. This patch adds `Char_U` in `REPL_BUILTIN_TYPES` to account for platforms that default to `unsigned char`. From e0cdd176e35d0

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I'm confused as to how this code ever compiled in the first place... In > > each case, this is C++ code that's failing: > > ``` > > /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common/san

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Amy Kwan via cfe-commits
amy-kwan wrote: > I'm confused as to how this code ever compiled in the first place... In each > case, this is C++ code that's failing: > > ``` > /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_po

[clang] 49b5208 - [X86][Headers] Specify result of NaN comparisons (#85862)

2024-03-21 Thread via cfe-commits
Author: Paul T Robinson Date: 2024-03-21T09:09:34-04:00 New Revision: 49b520856967c2354339d3c2a05fcf1d2d637f30 URL: https://github.com/llvm/llvm-project/commit/49b520856967c2354339d3c2a05fcf1d2d637f30 DIFF: https://github.com/llvm/llvm-project/commit/49b520856967c2354339d3c2a05fcf1d2d637f30.dif

[clang] [X86][Headers] Specify result of NaN comparisons (PR #85862)

2024-03-21 Thread Paul T Robinson via cfe-commits
https://github.com/pogo59 closed https://github.com/llvm/llvm-project/pull/85862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improves -print-library-module-manifest-path. (PR #85943)

2024-03-21 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/85943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Abhin P Jose via cfe-commits
Abhinkop wrote: > I'm confused as to how this code ever compiled in the first place... In each > case, this is C++ code that's failing: > > ``` > /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_po

<    1   2   3   4   >