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

2025-01-20 Thread Shafik Yaghmour via cfe-commits
@@ -48,24 +48,49 @@ namespace std __attribute__((__visibility__("default"))) { isnan(double __x); bool isnan(long double __x); -bool + bool isfinite(float __x); bool isfinite(double __x); bool isfinte(long double __x); - bool + bool isunordered(float _

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2025-01-21 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I would like to see some more compelling motivation for an extension here. https://github.com/llvm/llvm-project/pull/91070 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [clang][ExprConst] Let diagnostics point to std::allocator calls (PR #123744)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
@@ -1155,7 +1156,7 @@ namespace { if (CTSD->isInStdNamespace() && ClassII && ClassII->isStr("allocator") && TAL.size() >= 1 && TAL[0].getKind() == TemplateArgument::Type) - return {Call->Index, TAL[0].getAsType()}; + return {Cal

[clang] [clang][ExprConst] Let diagnostics point to std::allocator calls (PR #123744)

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

[clang] [clang][ExprConst] Let diagnostics point to std::allocator calls (PR #123744)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thanks, this would be an improvement but I have one concern with this change. https://github.com/llvm/llvm-project/pull/123744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
@@ -2290,18 +2290,21 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create( ASTContext &C, DeclContext *DC, SourceLocation StartLoc, ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstr

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
@@ -8147,6 +8149,26 @@ TEST_P(ImportFunctions, CTADWithLocalTypedef) { ASSERT_TRUE(ToD); } +TEST_P(ImportFunctions, CTADAliasTemplate) { + Decl *TU = getTuDecl( + R"( + template struct A { +A(T); + }; + template + using B = A; + B b{(i

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

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

[clang] [clang] Track source deduction guide for alias template deduction guides (PR #123875)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I know you have approvals but you should expand the tests first. https://github.com/llvm/llvm-project/pull/123875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang][Sema] Reject declaring an alias template with the same name as its template parameter. (PR #123533)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: when the discussion is eventually resolved please add a more detailed summary explaining how the fix is implemented and why. These go in the git log and it is important for relevant details to show up there w/o the need for git show etc https://github.com/

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. Please add a more detailed summary to this PR. I have asked this on several PRs and I believe the confusion reflected in the comments is very much attributed to not explaining why you believe your fix works. It may be incorrect b

[clang] [Clang][Sema] Reject declaring an alias template with the same name as its template parameter. (PR #123533)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
@@ -13464,6 +13464,14 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S, AccessSpecifier AS, } TemplateParameterList *TemplateParams = TemplateParamLists[0]; +// Check shadowing of a template parameter name +for (NamedDecl *TP : TemplateParams->asArray()) { +

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I see a lot of diagnostics were updated to `DefaultError` but I don't see matching tests that demonstrate the now error. We should be testing each diagnostic. https://github.com/llvm/llvm-project/pull/123470 ___

[clang] [clang] Return larger CXX records in memory (PR #120670)

2025-01-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Shouldn't this have some sort of Release not maybe under the X86 section? https://github.com/llvm/llvm-project/pull/120670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [Clang] Added nullptr check to getFriendDecl access (PR #121056)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM but I will let @cor3ntin give the accept https://github.com/llvm/llvm-project/pull/121056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -std=c++2c -verify -fsyntax-only %s + +template +void decompose_array() { + int arr[4] = {1, 2, 3, 5}; + auto [x, ... // #1 +rest, ...more_rest] = arr; // expected-error{{multiple packs in structured binding declaration}} +

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the PR, small comments. https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

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

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++26 %s -verify shafik wrote: +1 we should always cover all the examples from the proposal. https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mai

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > I see a lot of diagnostics were updated to `DefaultError` but I don't see > > matching tests that demonstrate the now error. We should be testing each > > diagnostic. > > #123464 also added `-Werror=return-type` to some tests; we can remove those > now, which should cover at

[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

2025-01-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I feel like matching gcc's behavior makes sense for users but I am not sure about the timing for clang-20. This seems like the change in behavior could be impactful. https://github.com/llvm/llvm-project/pull/122486 __

[clang] [clang] Fix a use-after-free in expression evaluation (PR #118480)

2025-01-24 Thread Shafik Yaghmour via cfe-commits
shafik wrote: ping, is this still a problem? https://github.com/llvm/llvm-project/pull/118480 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-01-24 Thread Shafik Yaghmour via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, 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 looks about right to me but I would like another set of eyes. https://github.com/llv

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

2025-01-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Flagging what looks like a bug https://github.com/llvm/llvm-project/pull/101469 ___ 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)

2025-01-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/101469 ___ 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)

2025-01-17 Thread Shafik Yaghmour via cfe-commits
@@ -1212,6 +1212,14 @@ static void handlePreferredName(Sema &S, Decl *D, const ParsedAttr &AL) { << TT->getDecl(); } +static void handleNoSpecializations(Sema &S, Decl *D, const ParsedAttr &AL) { + StringRef Message; + if (AL.getNumArgs() != 0) +S.checkStringLit

[clang] [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (PR #124478)

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

[clang] [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (PR #124478)

2025-01-26 Thread Shafik Yaghmour via cfe-commits
shafik wrote: First failure looks like a flaky build issue: https://github.com/llvm/llvm-project/issues/124485 https://github.com/llvm/llvm-project/pull/124478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (PR #124478)

2025-01-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/124478 When implmenting P2280R4 here: https://github.com/llvm/llvm-project/pull/95474 When creating the APValue to store and constexprUnknown value I used an offset of CharUnits::One() but it should have been CharUnits

[clang] [Clang] Fix createConstexprUnknownAPValues to use zero offset when ceating APValue (PR #124478)

2025-01-26 Thread Shafik Yaghmour via cfe-commits
shafik wrote: No Release notes b/c this is a fix for https://github.com/llvm/llvm-project/pull/95474 which has its own release note. Tests for this fix will be added by https://github.com/llvm/llvm-project/pull/124476 https://github.com/llvm/llvm-project/pull/124478 __

[clang] [clang] Prevent duplicated instantiation of enumerators of unscoped member enumerations (PR #124407)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?André?= Brand , =?utf-8?q?André?= Brand Message-ID: In-Reply-To: shafik wrote: > @cor3ntin Thanks! I just added some details to the GitHub description. I hope > it's not too verbose. And I rebased the branch to resolve the conflict in the > release notes. Terse summaries are reall

[clang] [Clang] Fix immediate escalation of template function specializations. (PR #124404)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
@@ -528,3 +528,21 @@ D d(0); // expected-note {{in implicit initialization for inherited constructor // expected-error@-1 {{call to immediate function 'GH112677::D::SimpleCtor' is not a constant expression}} } + +namespace GH123405 { + +consteval void fn() {} + +template +c

[clang] [Clang] Remove unnecessary Decl transform & profiles for SizeOfPackExpr (PR #124533)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: In my comment here, it really looks like a clang-17 regression: https://github.com/llvm/llvm-project/issues/124161#event-16079402729 >From what I can tell you also address the simplified version, so I believe a >release note is probably warrented. Are ther

[clang] [clang] Implement -fstrict-bool (PR #116732)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I second that we need to document how values outside of zero and one are handled. I would like also really want to see a test that demonstrates the behavior we are expecting to support with comments explaining the result and why we expect it. After seei

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/116708 ___ cfe-commits mailing list

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: https://github.com/shafik commented: Apologies if I somehow missed it but it looks like we are not really covering the diagnostics fully and we need to in

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: @@ -10134,6 +10137,24 @@ def note_format_fix_specifier : Note<"did you mean to use '%0'?">; def note_printf_c_str: Note<"did you mean to

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: @@ -10134,6 +10137,24 @@ def note_format_fix_specifier : Note<"did you mean to use '%0'?">; def note_printf_c_str: Note<"did you mean to

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-01-27 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID: In-Reply-To: @@ -10134,6 +10137,24 @@ def note_format_fix_specifier : Note<"did you mean to use '%0'?">; def note_printf_c_str: Note<"did you mean to

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

2025-01-28 Thread Shafik Yaghmour via cfe-commits
shafik wrote: ping, any chance we can make progress here? https://github.com/llvm/llvm-project/pull/112111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (PR #124793)

2025-01-28 Thread Shafik Yaghmour via cfe-commits
@@ -4861,8 +4861,9 @@ static void TryListInitialization(Sema &S, S.Context.hasSameUnqualifiedType(SubInit[0]->getType(), DestType) && "Deduced to other type?"); TryArrayCopy(S, - InitializationKind::CreateCopy(Kind.getLocatio

[clang] [clang] Add 'instantiated_from' for enums to the output of TextNodeDumper (PR #124409)

2025-01-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Definitely makes sense. Definitely we need a test, I think the right test to add an example to is `ast-dump-decl.cpp`. Could you also put a few more details in the summary, basically explain you are modifying `TextNodeDumper::VisitEnumDecl` to be more consi

[clang] [PGO] Add a clang option -fprofile-continuous that enables PGO continuous mode (PR #124353)

2025-01-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Please add a summary to your PR something like `Enables continuous PGO mode where profile counter updates are continuously synced to a file.` seems ok. This is what will show up in the git log and it useful to have more than a title in the log. https://gi

[clang] [Clang] disallow the use of asterisks preceding constructor and destructor names (PR #122621)

2025-01-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. Please add a more detailed summary, the title feels sufficient to describe the problem but you should outline the solution in the summary, at least briefly. e.g. adding `checkMethodPointerType` which will called during to verify

[clang] [Clang] disallow the use of asterisks preceding constructor and destructor names (PR #122621)

2025-01-12 Thread Shafik Yaghmour via cfe-commits
@@ -96,3 +96,13 @@ namespace PR38286 { template struct C; // expected-note {{non-type declaration found}} template C::~C() {} // expected-error {{identifier 'C' after '~' in destructor name does not name a type}} } + +namespace GH121706 { +struct S { + *S(); // expected-

[clang] [Clang] disallow the use of asterisks preceding constructor and destructor names (PR #122621)

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

[clang] [Sema] Note member decl when initializer list default constructs member (PR #121854)

2025-01-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. At a first glance this seems to make sense to me, I added some more reviewers. Please add a release note. https://github.com/llvm/llvm-project/pull/121854 ___ cfe-commits mailing list cfe-c

[clang] [clang] Evaluate constant initializers in C as well (PR #121950)

2025-01-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I would love to see tests that highlight any differences between C and C++ in this area. https://github.com/llvm/llvm-project/pull/121950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #121943)

2025-01-07 Thread Shafik Yaghmour via cfe-commits
@@ -284,11 +284,26 @@ void f(_Atomic(int) *i, const _Atomic(int) *ci, const volatile int flag_k = 0; volatile int flag = 0; - (void)(int)__atomic_test_and_set(&flag_k, memory_order_seq_cst); // expected-warning {{passing 'const volatile int *' to parameter of type 'vola

[clang] [Clang] Don't form a type constraint if the concept is invalid (PR #122065)

2025-01-08 Thread Shafik Yaghmour via cfe-commits
@@ -1969,7 +1970,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { if (OwnsDefaultArg) Record.AddTemplateArgumentLoc(D->getDefaultArgument()); - if (!TC && !OwnsDefaultArg && + if (!D->hasTypeConstraint() && !OwnsDefaultArg && -

[clang] [Clang] Don't form a type constraint if the concept is invalid (PR #122065)

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

[clang] [Clang] Don't form a type constraint if the concept is invalid (PR #122065)

2025-01-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: After commit review. Thank you for the fix. https://github.com/llvm/llvm-project/pull/122065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

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

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: `Lexer::findNextToken` has an additional check: `if (!Lexer::isAtEndOfMacroExpansion(Loc, SM, LangOpts, &Loc))` Does this not change behavior in the case we are replacing? I imagine folks just copied from `Lexer::findNextToken` and purposely left this out,

[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

2025-01-16 Thread Shafik Yaghmour via cfe-commits
@@ -118,47 +118,19 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer, return Results; } -/// Returns the next token after `Loc` (including comment tokens). -static std::optional getTokenAfter(SourceLocation Loc, shafik wrote: This looks li

[clang] [Clang] Correctly propagate type aliases' unexpanded flags up to lambda (PR #122875)

2025-01-16 Thread Shafik Yaghmour via cfe-commits
@@ -47,6 +49,10 @@ template void f() { }(), ...); }(1, 2); + [](Is...) { +([] { using T = ElementType; }(), ...); shafik wrote: Out of curiosity were applying the `getCanonicalType` to `T` and getting `int` while we really wanted `ElementType`?

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

2025-02-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM Assuming no objections from @tbaederr https://github.com/llvm/llvm-project/pull/125522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Shafik Yaghmour via cfe-commits
@@ -1648,8 +1648,11 @@ SourceLocation CallExpr::getBeginLoc() const { if (const auto *Method = dyn_cast_if_present(getCalleeDecl()); Method && Method->isExplicitObjectMemberFunction()) { -assert(getNumArgs() > 0 && getArg(0)); -return getArg(0)->getBeg

[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)

2025-02-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we please add more details in the summary about e.g. "This fixes a crash when ... and the fix is ..." https://github.com/llvm/llvm-project/pull/126868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [Clang] Do not emit nodiscard warnings for the base expr of static member access (PR #131450)

2025-03-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/131450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix an incorrect assumption on getTemplatedDecl() (PR #131559)

2025-03-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the quick fix, I would have also added the test that did not crash but issued a diagnostic from the issue as well: https://github.com/llvm/llvm-project/issues/131530 unless we have a similar test already. https://github.com/llvm/llvm-project/

[clang] [Clang] Increase the default expression nesting limit (PR #132021)

2025-03-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think you need to update this too, unless I missed something: https://clang.llvm.org/docs/UsersManual.html#controlling-implementation-limits https://github.com/llvm/llvm-project/pull/132021 ___ cfe-commits mailin

[clang] [libc] [clang] diagnose invalid member pointer class on instantiation (PR #132516)

2025-03-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Why was this landed w/o any approvals? https://github.com/llvm/llvm-project/pull/132516 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check PP presence when printing stats (PR #131608)

2025-03-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix! Second, that we need a summary explaining the problem and solution. Is this linked to a bug report, if it is, then we should mention that bug report as well. I would also like to see a test showing a case where we successfully print

[clang] [Clang] Do not create dependent CallExpr having UnresolvedLookupExpr inside non-dependent context (PR #124609)

2025-03-21 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Clang does crash with one of the included test cases, if you try to actually > use the function: https://godbolt.org/z/e6e6Ehjoj That is not a regression test, at minimum when fixing a bug we should include a test that directly reproduces the bug to ensure that we don't reintro

[clang] [clang][bytecode][NFC] Add assert to ptrauth_string_discriminator (PR #132527)

2025-03-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM, thank you for adding this comment! https://github.com/llvm/llvm-project/pull/132527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)

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

[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-18 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,182 @@ +// RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify +// RUN: %clang_cc1 %s -std=c++2c -fsyntax-only -verify -fexperimental-new-constant-interpreter + + +struct S0 {}; +struct S1 {int a;}; +struct S2 {int a; int b;}; +struct S3 {double a; int b; int c;};

[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-18 Thread Shafik Yaghmour via cfe-commits
@@ -257,7 +260,7 @@ Improvements to Clang's diagnostics as function arguments or return value respectively. Note that :doc:`ThreadSafetyAnalysis` still does not perform alias analysis. The feature will be default-enabled with ``-Wthread-safety`` in a future release. -- Th

[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)

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

[clang] [Clang] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-18 Thread Shafik Yaghmour via cfe-commits
@@ -368,7 +368,11 @@ std::optional SValBuilder::getConstantVal(const Expr *E) { case Stmt::TypeTraitExprClass: { const auto *TE = cast(E); -return makeTruthVal(TE->getValue(), TE->getType()); +if (TE->isStoredAsBoolean()) + return makeTruthVal(TE->getBoolVa

[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)

2025-03-18 Thread Shafik Yaghmour via cfe-commits
@@ -1911,6 +1911,38 @@ A simplistic usage example as might be seen in standard C++ headers follows: // Emulate type trait for compatibility with other compilers. #endif + +.. _builtin_structured_binding_size-doc: + +__builtin_structured_binding_size (C++) +---

[clang] [C++20][Modules] Prevent premature calls to PassInterestingDeclsToConsumer() within FinishedDeserializing(). (PR #129982)

2025-03-16 Thread Shafik Yaghmour via cfe-commits
@@ -10792,47 +10822,54 @@ void ASTReader::FinishedDeserializing() { --NumCurrentElementsDeserializing; if (NumCurrentElementsDeserializing == 0) { -// Propagate exception specification and deduced type updates along -// redeclaration chains. -// -// We do t

[clang] [C++20][Modules] Prevent premature calls to PassInterestingDeclsToConsumer() within FinishedDeserializing(). (PR #129982)

2025-03-16 Thread Shafik Yaghmour via cfe-commits
@@ -4309,12 +4309,12 @@ Decl *ASTReader::ReadDeclRecord(GlobalDeclID ID) { void ASTReader::PassInterestingDeclsToConsumer() { assert(Consumer); - if (PassingDeclsToConsumer) + if (!CanPassDeclsToConsumer) return; // Guard variable to avoid recursively redoing the

[clang] [Lex][Clang] Add checking to HeaderMapImpl::getString to make it more robust (PR #131677)

2025-04-05 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > LGTM with nit addressed. Test coverage would be nice to add, but not strictly > required if this is purely a defensive measure (which it seems to be). Exactly. https://github.com/llvm/llvm-project/pull/131677 ___ cfe-commits mailing l

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-04-05 Thread Shafik Yaghmour via cfe-commits
@@ -1913,8 +1919,9 @@ TEST_F(StructuralEquivalenceCacheTest, Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); + get<0>(TU)-

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-04-05 Thread Shafik Yaghmour via cfe-commits
@@ -1849,8 +1852,9 @@ TEST_F(StructuralEquivalenceCacheTest, ReturnStmtNonEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false);

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -156,11 +158,11 @@ struct StructuralEquivalenceTest : ::testing::Test { StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls01; StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls10; StructuralEquivalenceContext Ctx01( -

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -2080,9 +2090,9 @@ TEST_F(StructuralEquivalenceCacheTest, TemplateParmDepth) { EXPECT_FALSE(isInNonEqCache(std::make_pair(NonEqDecl0, NonEqDecl1), true)); StructuralEquivalenceContext Ctx_IgnoreTemplateParmDepth( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTCo

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -11432,6 +11433,22 @@ static QualType mergeEnumWithInteger(ASTContext &Context, const EnumType *ET, return {}; } +QualType ASTContext::mergeTagTypes(QualType LHS, QualType RHS) { + // C17 and earlier and C++ disallow two tag definitions within the same TU + // from bei

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -2003,8 +2012,9 @@ TEST_F(StructuralEquivalenceCacheTest, Cycle) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); + ge

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -9089,8 +9089,8 @@ bool Sema::hasStructuralCompatLayout(Decl *D, Decl *Suggested) { // FIXME: Add a specific mode for C11 6.2.7/1 in StructuralEquivalenceContext // and isolate from other C++ specific checks. StructuralEquivalenceContext Ctx( - D->getASTContext()

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1932,8 +1939,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclWithInitNoEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, fa

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1868,8 +1872,9 @@ TEST_F(StructuralEquivalenceCacheTest, VarDeclNoEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1826,8 +1828,9 @@ TEST_F(StructuralEquivalenceCacheTest, SimpleNonEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1572,13 +1571,12 @@ TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, if (RefConv & Sema::ReferenceConversions::DerivedToBase) { Kind = CK_DerivedToBase; -CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/true, - /*D

[clang] [clang] Fix static_cast bypassing access control (PR #132285)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -23,3 +22,66 @@ void test(A &a, B &b) { const A &&ar10 = static_cast(xvalue()); const A &&ar11 = static_cast(xvalue()); } + +struct C : private A { // expected-note 4 {{declared private here}} shafik wrote: Normally when we add tests to an existing file

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -1964,8 +1972,9 @@ TEST_F(StructuralEquivalenceCacheTest, SpecialNonEq) { Lang_CXX03); StructuralEquivalenceContext Ctx( - get<0>(TU)->getASTContext(), get<1>(TU)->getASTContext(), - NonEquivalentDecls, StructuralEquivalenceKind::Default, false, false); +

[clang] [C23] Implement WG14 N3037 (PR #132939)

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

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -4567,8 +4567,9 @@ namespace { Reader.getOwningModuleFile(Cat)) { StructuralEquivalenceContext::NonEquivalentDeclSet NonEquivalentDecls; StructuralEquivalenceContext Ctx( - Cat->getASTContext(), Existing->getASTCo

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: A lot of nits https://github.com/llvm/llvm-project/pull/132939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not create dependent CallExpr having UnresolvedLookupExpr inside non-dependent context (PR #124609)

2025-03-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I have a few concerns w/ this PR. Number one we do not cover the original test case which crashes, as far as I can tell none of the tests crash before this fix. This is large oversight. It looks like currently gcc is the only one that rejects this code as w

[clang] [C23] Implement WG14 N3037 (PR #132939)

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

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Second round of comments, I may make a third go around but I wouldn't wait for me. https://github.com/llvm/llvm-project/pull/132939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,472 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment -verify=both,c23 %s +// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment -Wno-c23-extensions -verify=both,c17 %s + +/* WG14 N3037: + * Improved tag compatibility + * + *

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,472 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment -verify=both,c23 %s +// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment -Wno-c23-extensions -verify=both,c17 %s + +/* WG14 N3037: + * Improved tag compatibility + * + *

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-03-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,472 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c23 -pedantic -Wall -Wno-comment -verify=both,c23 %s +// RUN: %clang_cc1 -fsyntax-only -std=c17 -pedantic -Wall -Wno-comment -Wno-c23-extensions -verify=both,c17 %s + +/* WG14 N3037: + * Improved tag compatibility + * + *

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -fexperimental-new-constant-interpreter -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * +

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c2y -pedantic -Wall -Wno-comment -fexperimental-new-constant-interpreter -verify %s + +/* WG14 N3369: Clang 21 + * _Lengthof operator + * +

[clang] [Clang] Correct the DeclRefExpr's Type after the initializer gets instantiated (PR #133212)

2025-03-27 Thread Shafik Yaghmour via cfe-commits
@@ -467,3 +467,29 @@ namespace VexingParse { template int var; // expected-note {{declared here}} int x(var); // expected-error {{use of variable template 'var' requires template arguments}} } + +#ifndef PRECXX11 + +namespace GH79750 { shafik wrote: I am

<    4   5   6   7   8   9   10   11   >