[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/112612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
@@ -39,7 +39,8 @@ bool Sema::SetMemberAccessSpecifier(NamedDecl *MemberDecl, AccessSpecifier LexicalAS) { if (!PrevMemberDecl) { // Use the lexical access specifier. -MemberDecl->setAccess(LexicalAS); shafik wrote:

[clang] [clang] Update the lifetimebound example with up-to-date expected warning and change the sample code to be a fully working example (PR #113437)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/113437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Update the lifetimebound example with up-to-date expected warning and change the sample code to be a fully working example (PR #113437)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
@@ -3702,20 +3702,32 @@ user-declared functions. For example: .. code-block:: c++ +#include +#include + +using namespace std::literals; + // Returns m[key] if key is present, or default_value if not. template const U &get_or_default(const std::map

[clang] [clang] Update the lifetimebound example with up-to-date expected warning and change the sample code to be a fully working example (PR #113437)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, other than the minor comment. https://github.com/llvm/llvm-project/pull/113437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang] fix the unexpected control flow in ParseTentative.cpp (PR #109298)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
shafik wrote: So this is the commit that introduced this 06e41ae5c77c6 and it looks like code like this: ```objc id x(id(0)); ``` we are trying to differentiate a protocol Vs the next parameter? https://github.com/llvm/llvm-project/pull/109298 ___ c

[clang] [clang] Check null TypeSourceInfo in CreateUnaryExprOrTypeTraitExpr (PR #112111)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +a() {struct b c (sizeof(b * [({ {tree->d* next)} 0 + +// expected-error@3 {{a type specifier is required for all declarations}} +// expected-error@3 {{use of undeclared identifier 'tree'; did you mean 'true'?}} +//

[clang] [clang] fix the unexpected control flow in ParseTentative.cpp (PR #109298)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: So I think on my last comment, using `break` as opposed to `continue` makes sense. Agree @cor3ntin https://github.com/llvm/llvm-project/pull/109298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] Nominate Shafik Yaghmour and Vlad Serebrennikov for C++ conformance (PR #114071)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/114071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Shafik and hstk30 as maintainers for issue triage (PR #114781)

2024-11-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/114781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Parser] Don't evaluate concept when its definition is invalid (PR #111179)

2024-11-05 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This crash looks linked to this change: https://github.com/llvm/llvm-project/issues/115004 https://github.com/llvm/llvm-project/pull/79 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Assuming it passes the test LGTM https://github.com/llvm/llvm-project/pull/112424 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix, I think this makes sense. Please add the tests I commented on and a release note. https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -74,7 +74,7 @@ int test13(int *a) { } int test14(int *a, int b) { - a = (int *)__builtin_assume_aligned(b, 32); // expected-error {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *}} + a = (int *)__builtin_assume_aligned(b, 32);

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
@@ -17957,6 +17957,8 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, << Name; Invalid = true; } + if (TUK == TagUseKind::Declaration && Name) shafik wrote: Why do we need to check `Name` as we

[clang] [clang] Check null TypeSourceInfo in CreateUnaryExprOrTypeTraitExpr (PR #112111)

2024-10-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: The fix looks good to me but I guess everyone needs to be happy w/ the test first. https://github.com/llvm/llvm-project/pull/112111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [llvm] [AArch64] Add soft-float ABI (PR #84146)

2024-10-28 Thread Shafik Yaghmour via cfe-commits
shafik wrote: ping https://github.com/llvm/llvm-project/pull/84146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] implement current CWG direction for string literal comparisons in constant evaluation (PR #109208)

2024-09-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: In case I don't get a chance to look at this in more detail right away can you please reference specific CWG issues in the summary and in comments in the code? Thank you. https://github.com/llvm/llvm-project/pull/109208 _

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

2024-09-23 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s + +struct A { shafik wrote: We should also test this case: ```cpp struct A { union { int n; int m=0; }; }; const A a; ``` https://github.com/llvm/llvm-project/pull/96301 _

[clang] [clang] Use std::optional::value_or (NFC) (PR #109894)

2024-09-26 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Next time please provide a better summary for your PR. This is super important for downstream folks debugging build breaks. In general this is important for reviews to compare what they expect with the actual diff. In this case something like "replace the use of conditional opera

[clang] [clang] fix assert in ADL finding entity in the implicit global module (PR #109882)

2024-09-26 Thread Shafik Yaghmour via cfe-commits
@@ -115,7 +115,7 @@ C++ Language Changes - Allow single element access of GCC vector/ext_vector_type object to be constant expression. Supports the `V.xyzw` syntax and other tidbits as seen in OpenCL. Selecting multiple elements is left as a future work. -- Implement `CWG18

[clang] [C++20][Modules] Restore inliness of constexpr/consteval functions defined in-class (PR #109470)

2024-09-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: The link you gave for the regression is not a llvm commit, is that the correct commit you meant to point to? https://github.com/llvm/llvm-project/pull/109470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] fix the unexpected control flow in ParseTentative.cpp (PR #109298)

2024-09-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: CC @tbaederr this does not look like equivalent code to me based on your original isue but maybe I am confused. https://github.com/llvm/llvm-project/pull/109298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [Clang] Distinguish expanding-packs-in-place cases for SubstTemplateTypeParmTypes (PR #114220)

2024-11-07 Thread Shafik Yaghmour via cfe-commits
@@ -3149,9 +3156,15 @@ struct ExpandPackedTypeConstraints assert(SemaRef.ArgumentPackSubstitutionIndex != -1); +TemplateArgument Arg = TemplateArgs(T->getDepth(), T->getIndex()); + +std::optional PackIndex; +if (Arg.getKind() == TemplateArgument::Pack) +

[clang] Recommit "[RISCV][FMV] Support target_version" (#111096)" (PR #111333)

2024-11-07 Thread Shafik Yaghmour via cfe-commits
shafik wrote: It looks like this change caused a regression: https://github.com/llvm/llvm-project/issues/115000 https://github.com/llvm/llvm-project/pull/111333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM https://github.com/llvm/llvm-project/pull/112612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix C23 constexpr crashes (PR #112708)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/112708 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Add soft-float ABI (PR #84146)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This is linked to the following regression: https://github.com/llvm/llvm-project/issues/111293 Please investigate. https://github.com/llvm/llvm-project/pull/84146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [llvm] [AArch64] Add soft-float ABI (PR #84146)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -180,7 +180,7 @@ namespace { bool HandleTopLevelDecl(DeclGroupRef DG) override { // FIXME: Why not return false and abort parsing? - if (Diags.hasErrorOccurred()) + if (Diags.hasUnrecoverableErrorOccurred()) shafik wrote: Is this really

[clang] [clang] Fix a crash issue that caused by handling of fields with initializers in nested anonymous unions (PR #113049)

2024-11-15 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Just wanted to ping on this and see how it was going. https://github.com/llvm/llvm-project/pull/113049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-11-15 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Looks like this PR was the cause of this regression: https://github.com/llvm/llvm-project/issues/116440 https://github.com/llvm/llvm-project/pull/78060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-17 Thread Shafik Yaghmour via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID: In-Reply-To: https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/108021 ___ cfe-commits mailin

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Note paper [Remove Deprecated Array Comparisons from C++26](https://wg21.link/p2865) although the lastest version is not public yet. https://github.com/llvm/llvm-project/pull/118031 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/118031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This looks good but I want agreement on the diagnostic message. https://github.com/llvm/llvm-project/pull/118031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
@@ -15,15 +15,15 @@ void test(const char *d) { if (NULL == "/") return; if ("/" != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} -return; +return; // cxx

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
@@ -15,15 +15,15 @@ void test(const char *d) { if (NULL == "/") return; if ("/" != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} -return; +return; // cxx

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-02 Thread Shafik Yaghmour via cfe-commits
@@ -10264,6 +10264,11 @@ def warn_depr_array_comparison : Warning< "to compare array addresses, use unary '+' to decay operands to pointers">, InGroup; +def warn_array_comparison : Warning< + "comparison between two arrays; " shafik wrote: Maybe "Compari

[clang] [C++20] Deleting destructors can be noexcept (PR #118687)

2024-12-04 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -Wno-unevaluated-expression -std=c++20 %s shafik wrote: We already have https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp mayb

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-12-03 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Looks like this caused a regression: https://github.com/llvm/llvm-project/issues/117975 https://github.com/llvm/llvm-project/pull/112521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Improve diagnostic on [[nodiscard]] attribute (PR #112521)

2024-12-03 Thread Shafik Yaghmour via cfe-commits
@@ -1615,22 +1615,24 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { return FnType->getReturnType(); } -const Attr *CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +std::pair +CallExpr::getUnusedResultAttr(const ASTContext &Ctx) const { +

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -33,23 +33,22 @@ Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{'init_ Two coo[2] __attribute__((init_priority(100))); #if !defined(SYSTEM) - // expected-error@-2 {{'init_priority' attribute requires integer constant between 101 and 65535 incl

[clang] [Clang][Parser] Don't evaluate concept when its definition is invalid (PR #111179)

2025-01-07 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This crash looks linked to this change: https://github.com/llvm/llvm-project/issues/121980 https://github.com/llvm/llvm-project/pull/79 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] Use range-based for to iterate over fields in record layout, NFC (PR #122029)

2025-01-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: nitpick, I don't think this is an NFC change. It would require some thought to really convince myself this did not have subtle behavior changes even if unintended. https://github.com/llvm/llvm-project/pull/122029 ___

[clang] [Clang] Introduce '--offload-targets=' to generically target toolchains (PR #125556)

2025-02-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Apologies, if I am missing it but I don't see a test emitting the diagnostic `err_drv_mix_offload` anywhere. https://github.com/llvm/llvm-project/pull/125556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-03 Thread Shafik Yaghmour via cfe-commits
@@ -248,4 +248,16 @@ __attribute__((optnone)) T func_22(T x, T y) { float func_23(float x, float y) { return func_22(x, y); -} \ No newline at end of file +} + +// CHECK-LABEL: FunctionDecl {{.*}} func_24 'vector2float (vector2double)' +// CHECK: CompoundStmt {{.*}}

[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

2025-02-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Can we also add a summary, explaining your implementation e.g. "added TrailingObjects to `ConvertVectorExpr` containing " https://github.com/llvm/llvm-project/pull/125522 ___ cfe-commits mailing list cfe-commi

[clang] [clang] CTAD alias: Respect explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-02-03 Thread Shafik Yaghmour via cfe-commits
@@ -237,8 +237,17 @@ static_assert(__is_same(decltype(s.t), int)); // explicit deduction guide. Foo(int) -> Foo; AFoo s2{i}; -// FIXME: the type should be X because of the above explicit deduction guide. -static_assert(__is_same(decltype(s2.t), int)); +static_assert(__is_same(d

[clang] [libcxxabi] [llvm] [Clang] Mangling of pack indexing type and expression for itanium (PR #123513)

2025-01-30 Thread Shafik Yaghmour via cfe-commits
@@ -30220,6 +30220,11 @@ const char* cases[][2] = { {"_ZZNH3Foo3fooES_iENK4Foo24foo2Ev", "Foo::foo(this Foo, int)::Foo2::foo2() const" }, {"_ZNH3FooclERKS_", "Foo::operator()(this Foo const&)"}, + +// C++26 pack indexing shafik wrote: We should a

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/124920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
@@ -53,3 +53,14 @@ alignas(4) auto PR19252 = 0; // Check the diagnostic message class alignas(void) AlignasVoid {}; // expected-error {{invalid application of 'alignas' to an incomplete type 'void'}} + +namespace GH108819 { +void a([[maybe_unused]] void) {} //

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense but we should have been coverage in testing. https://github.com/llvm/llvm-project/pull/124920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
@@ -124,6 +125,14 @@ void lambda_capture() { [&x...] { (void)sum(x...); }(); } +struct S2 { +int a, b, c; +}; + +auto X = [] () { shafik wrote: I feel like there are a bunch of varieties on this case we can test as well: https://godbolt.org/z/r9zxxfoW

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow attributes on void parameters (PR #124920)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/124920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Consolidate ResolvedUnpexandedPackExpr into FunctionParmPackExpr (PR #125394)

2025-02-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think I would like to see some more test coverage. https://github.com/llvm/llvm-project/pull/125394 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [Clang] Remove the PackExpansion restrictions for rewrite substitution (PR #126206)

2025-02-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I see the test references https://github.com/llvm/llvm-project/issues/124715 but you don't mention it in the summary and you don't have a release note. Does the test exercise the crash? https://github.com/llvm/llvm-project/pull/126206 __

[clang] [Wunsafe-buffer-usage] Turn off unsafe-buffer warning for methods annotated with clang::unsafe_buffer_usage attribute (PR #125671)

2025-02-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Should this have a release note? https://github.com/llvm/llvm-project/pull/125671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not try to transform invalid bindings (PR #125658)

2025-02-10 Thread Shafik Yaghmour via cfe-commits
@@ -188,3 +188,19 @@ void other_main() { static_assert(f() == 2); } } // namespace + + +namespace GH125165 { + +template +auto f(auto t) { +const auto& [...pack] = t; +// expected-error@-1 {{cannot decompose non-class, non-array type 'char const'}} +(pack, ...)

[clang] [-Wunsafe-buffer-usage] Fix assert when constexpr size passed to snprintf() (#119786) (PR #124022)

2025-02-11 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: When possible we should always add tests, I think the right place would be: https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/warn-unsafe-buffer-usage-libc-functions.cpp CC @ziqingluo-90 Do we need a release note or is this feature clang-20

[clang] [libcxxabi] [llvm] [Clang] Mangling of pack indexing type and expression for itanium (PR #123513)

2025-01-30 Thread Shafik Yaghmour via cfe-commits
@@ -5828,6 +5822,15 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity, break; } + case Expr::PackIndexingExprClass: { +auto *PE = cast(E); +NotPrimaryExpr(); shafik wrote: I am looking at the test cases and I don't see the

[clang] [libcxxabi] [llvm] [Clang] Mangling of pack indexing type and expression for itanium (PR #123513)

2025-01-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense but let's make sure we cover all the added branches in the test suite. https://github.com/llvm/llvm-project/pull/123513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [libcxxabi] [llvm] [Clang] Mangling of pack indexing type and expression for itanium (PR #123513)

2025-01-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/123513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] enhance error recovery with RecoveryExpr for trailing commas in call arguments (PR #114684)

2025-01-31 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This PR is linked to the following regression: https://github.com/llvm/llvm-project/issues/125225 https://github.com/llvm/llvm-project/pull/114684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang][Sema] Add diagnostic note for reference of function-like macros requiring without parentheses (PR #123495)

2025-01-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Adding to the current comments. https://github.com/llvm/llvm-project/pull/123495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Add diagnostic note for reference of function-like macros requiring without parentheses (PR #123495)

2025-01-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/123495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Add diagnostic note for reference of function-like macros requiring without parentheses (PR #123495)

2025-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -159,12 +160,13 @@ void test() { // expected-note@-3 {{cannot use initializer list at the beginning of a macro argument}} } -// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{145:11-145:11}:"(" -// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{145:23-145

[clang] [clang][Sema] Add diagnostic note for reference of function-like macros requiring without parentheses (PR #123495)

2025-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -180,3 +182,11 @@ void test2() { // expected-error@-3 {{use of undeclared identifier}} // expected-note@-4 {{cannot use initializer list at the beginning of a macro argument}} } + +#define LIM() 10 +// expected-note@-1 {{'LIM' is defined here as a function-like macro;

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-16 Thread Shafik Yaghmour via cfe-commits
shafik wrote: ping on this we have another regression linked to the original change: https://github.com/llvm/llvm-project/issues/120086 We really should land a fix ASAP, this is now three regression linked to the same change. https://github.com/llvm/llvm-project/pull/114217 _

[clang] [clang][ObjectiveC] Fix Parsing Method Parameter Types with the `::` Prefix (PR #119908)

2024-12-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This should have a release note. https://github.com/llvm/llvm-project/pull/119908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Just merged in main since it has been so long in prep for updates https://github.com/llvm/llvm-project/pull/95474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 1/6] [Clang] Implement P2280R4 Using unknown pointers and refere

[clang] [compiler-rt] [llvm] [TySan] A Type Sanitizer (Runtime Library) (PR #76261)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I guess there are no release notes or manual b/c this is not ready to be used by general users on the command line and that will come via another PR? https://github.com/llvm/llvm-project/pull/76261 ___ cfe-commits

[clang] [compiler-rt] [llvm] [TySan] A Type Sanitizer (Runtime Library) (PR #76261)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_tysan -O0 %s -o %t && %run %t >%t.out 2>&1 +// RUN: FileCheck %s < %t.out + +#include + +// CHECK-NOT: ERROR: TypeSanitizer: type-aliasing-violation + +int main() { + union { +int i; +short s; + } u; + + u.i = 42; + u.s = 1; + + print

[clang] [compiler-rt] [llvm] [TySan] A Type Sanitizer (Runtime Library) (PR #76261)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,65 @@ +// RUN: %clang_tysan -O0 %s -o %t && %run %t 10 >%t.out.0 2>&1 +// RUN: FileCheck %s < %t.out.0 +// RUN: %clang_tysan -O2 %s -o %t && %run %t 10 >%t.out 2>&1 +// RUN: FileCheck %s < %t.out + +#include +#include +#include + +void __attribute__((noinline)) add_f

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID: In-Reply-To: https://github.com/shafik commented: This will eventually need a release note. https://github.com/llvm/llvm-project/pull/119711 __

[clang] [Clang] Fix crash for incompatible types in inline assembly (PR #119098)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. Please add a more detailed summary, these are important since they go into the git log and can be important for debugging downstream breaks. Something like "Fix by adding check in ActOnGCCAsmStmt that the domains of the input and out

[clang] [Clang] Fix crash for incompatible types in inline assembly (PR #119098)

2024-12-17 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I just realized it was already merged https://github.com/llvm/llvm-project/pull/119098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 1/7] [Clang] Implement P2280R4 Using unknown pointers and refere

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 1/8] [Clang] Implement P2280R4 Using unknown pointers and refere

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: We have a new crash on new code introduced since I last worked on this, I am guessing it just requires some additional checks. https://github.com/llvm/llvm-project/pull/95474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 1/9] [Clang] Implement P2280R4 Using unknown pointers and refere

[clang] [clang] Fix dangling false positives for conditional operators. (PR #120233)

2024-12-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Please add more details to the summary, especially a note that there theoretically could be false negatives but it fixes the overall issue and the tradeoff good. https://github.com/llvm/llvm-project/pull/120233 __

[clang] [clang] Informative error for lifetimebound in decl-spec (PR #118567)

2024-12-19 Thread Shafik Yaghmour via cfe-commits
@@ -3703,8 +3703,14 @@ void Parser::ParseDeclarationSpecifiers( // We reject AT_LifetimeBound and AT_AnyX86NoCfCheck, even though they // are type attributes, because we historically haven't allowed these // to be used as type attributes in C++11

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 01/12] [Clang] Implement P2280R4 Using unknown pointers and refe

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 01/11] [Clang] Implement P2280R4 Using unknown pointers and refe

[clang] (reland) [clang] Warn [[clang::lifetimebound]] misusages on types (PR #118501)

2024-12-19 Thread Shafik Yaghmour via cfe-commits
@@ -8612,7 +8612,11 @@ static void HandleLifetimeBoundAttr(TypeProcessingState &State, CurType = State.getAttributedType( createSimpleAttr(State.getSema().Context, Attr), CurType, CurType); +return; } + State.getSema().Diag(Attr.getLoc(), diag::err_

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH 01/10] [Clang] Implement P2280R4 Using unknown pointers and refe

[clang] Fix double-quotes in diagnostic when attempting to access a ext_vector of bools (PR #118186)

2024-12-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for your contribution, please add a more detailed summary to your PR. Your summary should if your title describes the problem sufficiently describe how you will fix the problem. https://github.com/llvm/llvm-project/pull/118186

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-12-06 Thread Shafik Yaghmour via cfe-commits
@@ -3190,19 +3190,27 @@ static void GenerateHeaderSearchArgs(const HeaderSearchOptions &Opts, auto It = Opts.UserEntries.begin(); auto End = Opts.UserEntries.end(); - // Add -I... and -F... options in order. - for (; It < End && Matches(*It, {frontend::Angled}, std::nul

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-12-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: nitpick https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

2024-12-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/105738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash when compiling error with invalid decl (PR #77893)

2024-12-03 Thread Shafik Yaghmour via cfe-commits
@@ -40,7 +40,11 @@ static_assert( "Type is insufficiently aligned"); APValue::LValueBase::LValueBase(const ValueDecl *P, unsigned I, unsigned V) -: Ptr(P ? cast(P->getCanonicalDecl()) : nullptr), Local{I, V} {} +: Ptr(P ? cast(P->getCanonicalDecl()->isInvalidDecl()

[clang] [Clang] Add '-Warray-compare' flag for C++ below version 20 (PR #118031)

2024-12-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Looks good, looking forward to the follow-up PR. https://github.com/llvm/llvm-project/pull/118031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

2024-12-06 Thread Shafik Yaghmour via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/shafik commented: Am I missing something, it seems like several of the new diagnostics don't have tests that cover them. https://github.com/llvm/llvm-project/pull/118475 __

[clang] [Clang] Fix warning for non std functions with name `infinity` (PR #123417)

2025-01-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/123417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix warning for non std functions with name `infinity` (PR #123417)

2025-01-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/123417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix warning for non std functions with name `infinity` (PR #123417)

2025-01-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: quick questions https://github.com/llvm/llvm-project/pull/123417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix warning for non std functions with name `infinity` (PR #123417)

2025-01-20 Thread Shafik Yaghmour via cfe-commits
@@ -216,11 +244,18 @@ int compareit(float a, float b) { // no-inf-no-nan-warning@+2 {{use of infinity is undefined behavior due to the currently enabled floating-point options}} // no-inf-warning@+1 {{use of infinity is undefined behavior due to the currently enabled floatin

<    3   4   5   6   7   8   9   10   11   >