[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

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

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Just a nit https://github.com/llvm/llvm-project/pull/68059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex", /*opt*/

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex", /*opt*/

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, just fill out the description with some more details so folks reading git log will have more context, https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list cfe-commits@

[clang] [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > FWIW, I spoke offline with the original author of the PR and he said that > he's fine with me picking up the changes and carrying the review forward. > > Because I don't know of any better way to commandeer a patch in GitHub, I'll > probably grab the changes, get them into my o

[clang] [clang][Sema] Emit more specific diagnostic for auto in lambda before C++14 (#46059) (PR #68540)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -3605,8 +3605,11 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, Info = &SemaRef.InventedParameterInfos.back(); } else { // In C++14, generic lambdas allow 'auto' in their parameters. -if (!SemaRef.getLangOpts().CPlu

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -5536,10 +5538,24 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee &OrigCallee break; } } + +if (const auto *MD = +dyn_cast_if_present(OCE->getCalleeDecl()); +MD && MD->isStatic()) + StaticOperator = true

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -7806,7 +7806,8 @@ class ExprEvaluatorBase // Overloaded operator calls to member functions are represented as normal // calls with '*this' as the first argument. const CXXMethodDecl *MD = dyn_cast(FD); - if (MD && MD->isImplicitObjectMemberFunction()

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -5536,10 +5538,24 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee &OrigCallee break; } } + +if (const auto *MD = +dyn_cast_if_present(OCE->getCalleeDecl()); +MD && MD->isStatic()) + StaticOperator = true

[clang] cc1b666 - [Clang] Fix member lookup so that we don't ignore ambiguous lookups in some cases

2023-07-28 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-07-28T15:21:57-07:00 New Revision: cc1b6668c57170cd440d321037ced89d6a61a9cb URL: https://github.com/llvm/llvm-project/commit/cc1b6668c57170cd440d321037ced89d6a61a9cb DIFF: https://github.com/llvm/llvm-project/commit/cc1b6668c57170cd440d321037ced89d6a61a9cb.dif

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-07 Thread Shafik Yaghmour via cfe-commits
@@ -96,6 +96,21 @@ void JSONNodeDumper::Visit(QualType T) { JOS.attribute("qualifiers", T.split().Quals.getAsString()); } +void JSONNodeDumper::Visit(TypeLoc TL) { + if (TL.isNull()) +return; + JOS.attribute("kind", +(llvm::Twine(TL.getTypeLocClass() ==

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > form when the user doesn't know what happens when integers of different signs > are compared (the signed one is cast to an unsigned value). I just wanted to point out that although this is very much an edge case, but mixed sign comparison can result in conversion to signed type

[clang] [sema] Improve -Wsign-compare (PR #65684)

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

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14490,12 +14564,12 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T, /// Analyze the given compound assignment for the possible losing of /// floating-point precision. -static void AnalyzeCompoundAssignment(Sema &S, BinaryOperator *E) { +void ImplicitCo

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Looks good overall, just the one side case I mentioned should be tested and mostly small nits. https://github.com/llvm/llvm-project/pull/65684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -15423,29 +15489,29 @@ static void AnalyzeImplicitConversions( // FIXME: Use a more uniform representation for this. for (auto *SE : POE->semantics()) if (auto *OVE = dyn_cast(SE)) -WorkList.push_back({OVE->getSourceExpr(), CC, IsListInit}); +Wo

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14043,28 +14039,61 @@ static bool CheckTautologicalComparison(Sema &S, BinaryOperator *E, return true; } +namespace { +struct AnalyzeImplicitConversionsWorkItem { + Expr *E; + SourceLocation CC; + unsigned IsListInit : 1; + unsigned IsTopLevelExpr : 1; +}; + +class

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14308,22 +14382,22 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, /// Analyze the given simple or compound assignment for warning-worthy /// operations. -static void AnalyzeAssignment(Sema &S, BinaryOperator *E) { +void ImplicitConversi

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14135,8 +14164,8 @@ static void AnalyzeComparison(Sema &S, BinaryOperator *E) { // Go ahead and analyze implicit conversions in the operands. Note // that we skip the implicit conversions on both sides. - AnalyzeImplicitConversions(S, LHS, E->getOperatorLoc()); - A

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -15277,35 +15351,33 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T, } } -static void CheckConditionalOperator(Sema &S, AbstractConditionalOperator *E, - SourceLocation CC, QualType T); - -static void CheckCondi

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14308,22 +14382,22 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, /// Analyze the given simple or compound assignment for warning-worthy /// operations. -static void AnalyzeAssignment(Sema &S, BinaryOperator *E) { +void ImplicitConversi

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14308,22 +14382,22 @@ static bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, /// Analyze the given simple or compound assignment for warning-worthy /// operations. -static void AnalyzeAssignment(Sema &S, BinaryOperator *E) { +void ImplicitConversi

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,129 @@ +// RUN: %clang_cc1 -fsyntax-only -Wsign-compare -Wno-unused-comparison -Wno-empty-body -Wno-unused-value -verify %s +// RUN: cp %s %t +// RUN: %clang_cc1 -fsyntax-only -Wsign-compare -fixit -x c %t 2> /dev/null +// RUN: grep -v CHECK %t | FileCheck %s + +unsign

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -15423,29 +15489,29 @@ static void AnalyzeImplicitConversions( // FIXME: Use a more uniform representation for this. for (auto *SE : POE->semantics()) if (auto *OVE = dyn_cast(SE)) -WorkList.push_back({OVE->getSourceExpr(), CC, IsListInit}); +Wo

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -15277,35 +15351,33 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T, } } -static void CheckConditionalOperator(Sema &S, AbstractConditionalOperator *E, - SourceLocation CC, QualType T); - -static void CheckCondi

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -15478,7 +15544,7 @@ static void AnalyzeImplicitConversions( // Ignore checking string literals that are in logical and operators. // This is a common pattern for asserts. continue; -WorkList.push_back({ChildExpr, CC, IsListInit}); +WorkList.push_ba

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/65684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sema] Improve -Wsign-compare (PR #65684)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Yes, there's this way and also when you compare integers smaller than `int`, > but those don't trigger -Wsign-compare. -Wsign-compare only triggers if a > signed operand is converted to an unsigned operand. This is a PR description > bug :) I did not understand that. I can see

[clang] [clang][VarDecl] Reset un-evaluated constant for all C++ modes (PR #65818)

2023-09-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: LGTM, thank you for the quick fix! https://github.com/llvm/llvm-project/pull/65818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix out of line Concept-comparisons of NestedNameSpecifiers (PR #65993)

2023-09-11 Thread Shafik Yaghmour via cfe-commits
@@ -231,14 +231,18 @@ Response HandleFunctionTemplateDecl(const FunctionTemplateDecl *FTD, MultiLevelTemplateArgumentList &Result) { if (!isa(FTD->getDeclContext())) { NestedNameSpecifier *NNS = FTD->getTemplatedDecl()->getQualifier();

[clang] Fix out of line Concept-comparisons of NestedNameSpecifiers (PR #65993)

2023-09-11 Thread Shafik Yaghmour via cfe-commits
@@ -231,14 +231,18 @@ Response HandleFunctionTemplateDecl(const FunctionTemplateDecl *FTD, MultiLevelTemplateArgumentList &Result) { if (!isa(FTD->getDeclContext())) { NestedNameSpecifier *NNS = FTD->getTemplatedDecl()->getQualifier();

[clang] Fix out of line Concept-comparisons of NestedNameSpecifiers (PR #65993)

2023-09-11 Thread Shafik Yaghmour via cfe-commits
@@ -231,14 +231,18 @@ Response HandleFunctionTemplateDecl(const FunctionTemplateDecl *FTD, MultiLevelTemplateArgumentList &Result) { if (!isa(FTD->getDeclContext())) { NestedNameSpecifier *NNS = FTD->getTemplatedDecl()->getQualifier();

[clang] 6eadc8f - [Clang] Fix crash in Parser::ParseDirectDeclarator by adding check that token is not an annotation token

2023-09-12 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-09-12T11:06:06-07:00 New Revision: 6eadc8f16e03f6aa3b1b1c178c308ac452eabeac URL: https://github.com/llvm/llvm-project/commit/6eadc8f16e03f6aa3b1b1c178c308ac452eabeac DIFF: https://github.com/llvm/llvm-project/commit/6eadc8f16e03f6aa3b1b1c178c308ac452eabeac.dif

[clang] [ASTImport]improve ast comparation (PR #66110)

2023-09-12 Thread Shafik Yaghmour via cfe-commits
@@ -1295,6 +1306,21 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, return true; } +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, shafik wrote: Should we also be checking the storage class and th

[clang] [ASTImport]improve ast comparation (PR #66110)

2023-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/66270: Currently CXXRewrittenBinaryOperator::getDecomposedForm(...) may crash if the spaceship operator returns a comparison category by reference. This because IgnoreImplicitAsWritten() does not look through CXXConstruc

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -15090,8 +15093,9 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T, if (SourceBT && TargetBT && SourceBT->isIntegerType() && TargetBT->isFloatingType() && !IsListInit) { // Determine the number of precision bits in the source integer type. -

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -15159,16 +15163,16 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T, IntRange SourceTypeRange = IntRange::forTargetOfCanonicalType(S.Context, Source); - IntRange LikelySourceRange = - GetExprRange(S.Context, E, S.isConstantEvaluated(), /*A

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -14143,8 +14145,9 @@ static void AnalyzeComparison(Sema &S, BinaryOperator *E) { } // Otherwise, calculate the effective range of the signed operand. - IntRange signedRange = GetExprRange( - S.Context, signedOperand, S.isConstantEvaluated(), /*Approximate*/ true)

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -13928,7 +13930,7 @@ static bool CheckTautologicalComparison(Sema &S, BinaryOperator *E, return false; IntRange OtherValueRange = GetExprRange( - S.Context, Other, S.isConstantEvaluated(), /*Approximate*/ false); + S.Context, Other, S.isConstantEvaluatedCon

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -13928,7 +13930,7 @@ static bool CheckTautologicalComparison(Sema &S, BinaryOperator *E, return false; IntRange OtherValueRange = GetExprRange( - S.Context, Other, S.isConstantEvaluated(), /*Approximate*/ false); + S.Context, Other, S.isConstantEvaluatedCon

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
@@ -9843,30 +9833,44 @@ class Sema final { /// diagnostics that will be suppressed. std::optional isSFINAEContext() const; - /// Determines whether we are currently in a context that - /// is not evaluated as per C++ [expr] p5. - bool isUnevaluatedContext() const { + /

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: If the function is `constexpr` do we treat it as a VLA? https://github.com/llvm/llvm-project/pull/66222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/66270: >From b934841d7fc3d3447b23a9718a38742943f76916 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Wed, 13 Sep 2023 11:09:28 -0700 Subject: [PATCH 1/2] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Perhaps it needs a release note? You would think I would remember this by now. https://github.com/llvm/llvm-project/pull/66270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang] Fix wrong warning about missing init for flexible array members (PR #66341)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for the quick fix https://github.com/llvm/llvm-project/pull/66341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-09-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik review_requested https://github.com/llvm/llvm-project/pull/66436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,84 @@ +//===- llvm/unittest/ADT/PagedVectorTest.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this contributions, I just have one comment so far on testing. We should make sure any new ADT is very well tested before landing it. https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits m

[clang] c9ef33e - [Clang] Fix crash when emitting diagnostic for out of order designated initializers in C++

2023-07-14 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-07-14T15:57:51-07:00 New Revision: c9ef33e1d8a8aeb68a18f24af6d9fc9ab4ecf257 URL: https://github.com/llvm/llvm-project/commit/c9ef33e1d8a8aeb68a18f24af6d9fc9ab4ecf257 DIFF: https://github.com/llvm/llvm-project/commit/c9ef33e1d8a8aeb68a18f24af6d9fc9ab4ecf257.dif

[clang] 33b6b67 - [clang] Fix crash in __builtin_strncmp and other related builtin functions

2023-08-25 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-08-25T13:54:50-07:00 New Revision: 33b6b674620d77e615d569f504b306aac528bab7 URL: https://github.com/llvm/llvm-project/commit/33b6b674620d77e615d569f504b306aac528bab7 DIFF: https://github.com/llvm/llvm-project/commit/33b6b674620d77e615d569f504b306aac528bab7.dif

[clang] 6f30ef3 - [Clang] Modify Parser::ParseLambdaExpressionAfterIntroducer to check whether the lambda-declarator is valid

2023-08-29 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-08-29T11:28:57-07:00 New Revision: 6f30ef360127ffb3346fd3d3e60a229ed44dc667 URL: https://github.com/llvm/llvm-project/commit/6f30ef360127ffb3346fd3d3e60a229ed44dc667 DIFF: https://github.com/llvm/llvm-project/commit/6f30ef360127ffb3346fd3d3e60a229ed44dc667.dif

[clang] [AST] Only dump desugared type when visibly different (PR #65214)

2023-09-05 Thread Shafik Yaghmour via cfe-commits
shafik wrote: So it looks like some of these changes undo some of the change introduced by @mizvekov in some tests. Maybe @zygoloid or @AaronBallman has some more input here. https://github.com/llvm/llvm-project/pull/65214 ___ cfe-commits mailing lis

[clang] [AST] Fix nested name specifiers printing as NamespaceNamespace (PR #65266)

2023-09-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/65266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Fix nested name specifiers printing as NamespaceNamespace (PR #65266)

2023-09-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM but we should test all changes. https://github.com/llvm/llvm-project/pull/65266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Fix nested name specifiers printing as NamespaceNamespace (PR #65266)

2023-09-05 Thread Shafik Yaghmour via cfe-commits
@@ -792,11 +793,11 @@ void clang::TextNodeDumper::dumpNestedNameSpecifier(const NestedNameSpecifier *N OS << " '" << NNS->getAsIdentifier()->getName() << "'"; break; case NestedNameSpecifier::Namespace: - OS << " Namespace"; + OS << " "; // "Namespace

[clang] [Clang] Fix the for statement disappearing in AST when an error occurs in the conditional expression of the for statement (PR #65381)

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

[clang] [Clang] Fix the for statement disappearing in AST when an error occurs in the conditional expression of the for statement (PR #65381)

2023-09-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This looks good to me but I would like another set of eyes on it. https://github.com/llvm/llvm-project/pull/65381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang] Fix the for statement disappearing in AST when an error occurs in the conditional expression of the for statement (PR #65381)

2023-09-06 Thread Shafik Yaghmour via cfe-commits
@@ -2158,8 +2158,10 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) { // for-range-declaration next. bool MightBeForRangeStmt = !ForRangeInfo.ParsedForRangeDecl(); ColonProtectionRAIIObject ColonProtection(*this, MightBeForRange

[clang] [AST] Only dump desugared type when visibly different (PR #65214)

2023-09-06 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > So it looks like some of these changes undo some of the change introduced > > by @mizvekov in some tests. Maybe @zygoloid or @AaronBallman has some more > > input here. > > Do you have a pointer to such changes? One of the commits is here: 15f3cd6bfc670 I know he did a lot

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: nit https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Shafik Yaghmour via cfe-commits
@@ -4588,28 +4641,29 @@ std::string CompilerInvocation::getModuleHash() const { return toString(llvm::APInt(64, Hash), 36, /*Signed=*/false); } -void CompilerInvocation::generateCC1CommandLine( +void CompilerInvocationBase::generateCC1CommandLine( ArgumentConsumer Consu

[clang] 54be300 - [Clang] Fix Sema::ClassifyName so that it classifies EnumConstantDecl as NonType when they are brought into scope via using enum

2022-11-29 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-11-29T10:39:21-08:00 New Revision: 54be300f7e0bc4edaf54e9289b2380bd210a37bc URL: https://github.com/llvm/llvm-project/commit/54be300f7e0bc4edaf54e9289b2380bd210a37bc DIFF: https://github.com/llvm/llvm-project/commit/54be300f7e0bc4edaf54e9289b2380bd210a37bc.dif

[clang] ef10f81 - [Clang] Adjust assert from Sema::BuildCXXTypeConstructExpr

2022-12-01 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-12-01T09:40:18-08:00 New Revision: ef10f81985f665c553c818e1c5962aebb8f36f0c URL: https://github.com/llvm/llvm-project/commit/ef10f81985f665c553c818e1c5962aebb8f36f0c DIFF: https://github.com/llvm/llvm-project/commit/ef10f81985f665c553c818e1c5962aebb8f36f0c.dif

[clang] c41be8f - [Clang] Fix ClassifyImplicitMemberAccess to handle cases where the access in an unevaluated context is not within a CXXRecordDecl or CXXMethodDecl

2023-03-14 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-03-14T16:37:58-07:00 New Revision: c41be8fc741dec82e6c628d0cad742285be293f6 URL: https://github.com/llvm/llvm-project/commit/c41be8fc741dec82e6c628d0cad742285be293f6 DIFF: https://github.com/llvm/llvm-project/commit/c41be8fc741dec82e6c628d0cad742285be293f6.dif

[clang] d1fcce9 - [Clang] Fix crash in isCXXDeclarationSpecifier when attempting to annotate template name

2023-06-29 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-06-29T15:42:18-07:00 New Revision: d1fcce97a6af872e64b365d80d5b85eb94487dc8 URL: https://github.com/llvm/llvm-project/commit/d1fcce97a6af872e64b365d80d5b85eb94487dc8 DIFF: https://github.com/llvm/llvm-project/commit/d1fcce97a6af872e64b365d80d5b85eb94487dc8.dif

[clang] 20a3fb9 - [Clang] Fix how ReadMacroParameterList handles comments in macro parameter-list when in -CC mode

2023-03-30 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-03-30T13:37:21-07:00 New Revision: 20a3fb9740ddadc61fbc8bc76836935d1a408d83 URL: https://github.com/llvm/llvm-project/commit/20a3fb9740ddadc61fbc8bc76836935d1a408d83 DIFF: https://github.com/llvm/llvm-project/commit/20a3fb9740ddadc61fbc8bc76836935d1a408d83.dif

[clang] b206cde - [Clang][Attributes] Add MeaningfulToClassTemplateDefinition to unavailable attribute

2023-04-06 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-04-06T14:40:39-07:00 New Revision: b206cde3504c0078469f02bd74aeb5eb5ab875f5 URL: https://github.com/llvm/llvm-project/commit/b206cde3504c0078469f02bd74aeb5eb5ab875f5 DIFF: https://github.com/llvm/llvm-project/commit/b206cde3504c0078469f02bd74aeb5eb5ab875f5.dif

[clang] d89c653 - [Clang] Fix filtering of inline namespaces for friend functions

2023-04-07 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-04-07T08:58:39-07:00 New Revision: d89c6530fdb57da31f4750bf941a0e4a090c4474 URL: https://github.com/llvm/llvm-project/commit/d89c6530fdb57da31f4750bf941a0e4a090c4474 DIFF: https://github.com/llvm/llvm-project/commit/d89c6530fdb57da31f4750bf941a0e4a090c4474.dif

[clang] f9b854b - [Clang] Fix buildbots after Fix filtering of inline namespaces for friend functions commit

2023-04-07 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-04-07T09:18:15-07:00 New Revision: f9b854bc8f0bfe2a38b00fab401bb1982eb8e61e URL: https://github.com/llvm/llvm-project/commit/f9b854bc8f0bfe2a38b00fab401bb1982eb8e61e DIFF: https://github.com/llvm/llvm-project/commit/f9b854bc8f0bfe2a38b00fab401bb1982eb8e61e.dif

[clang] 6d0fab4 - [Clang] Fix defaulted equality operator so that it does not attempt to compare unnamed bit-fields

2023-04-14 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-04-14T15:01:00-07:00 New Revision: 6d0fab467efbc7ce92bd890d9618259c4995ddcc URL: https://github.com/llvm/llvm-project/commit/6d0fab467efbc7ce92bd890d9618259c4995ddcc DIFF: https://github.com/llvm/llvm-project/commit/6d0fab467efbc7ce92bd890d9618259c4995ddcc.dif

[clang] 2a23de0 - [Clang] Switch from TransformExpr to TransformInitializer in places we need to revert initializer to it syntactic form for Sema

2023-05-25 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-05-25T09:50:56-07:00 New Revision: 2a23de01e51545d01055229baea4d4a296b65058 URL: https://github.com/llvm/llvm-project/commit/2a23de01e51545d01055229baea4d4a296b65058 DIFF: https://github.com/llvm/llvm-project/commit/2a23de01e51545d01055229baea4d4a296b65058.dif

[clang] d6d59e6 - [Clang] Fix __VA_OPT__ implementation so that it treats the concatenation of a non-placemaker token and placemaker token as a non-placemaker token

2023-02-17 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-02-17T14:57:32-08:00 New Revision: d6d59e660bc75d14f423fb3817834f832bbf4543 URL: https://github.com/llvm/llvm-project/commit/d6d59e660bc75d14f423fb3817834f832bbf4543 DIFF: https://github.com/llvm/llvm-project/commit/d6d59e660bc75d14f423fb3817834f832bbf4543.dif

[clang] b4692f2 - [Clang] Updating handling of defaulted comparison operators to reflect changes from P2448R2

2023-05-04 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-05-04T11:07:16-07:00 New Revision: b4692f29263006c7ea519c7b11c9082384f0af53 URL: https://github.com/llvm/llvm-project/commit/b4692f29263006c7ea519c7b11c9082384f0af53 DIFF: https://github.com/llvm/llvm-project/commit/b4692f29263006c7ea519c7b11c9082384f0af53.dif

[clang] 7887af0 - Fix build bots due to missing a commit thay change 2b to 23

2023-05-04 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-05-04T11:33:58-07:00 New Revision: 7887af027ee5eff27bbc953074726ab8d9d9f592 URL: https://github.com/llvm/llvm-project/commit/7887af027ee5eff27bbc953074726ab8d9d9f592 DIFF: https://github.com/llvm/llvm-project/commit/7887af027ee5eff27bbc953074726ab8d9d9f592.dif

[clang] 96bc786 - [Clang] Update warning on some designator initializer cases involving unions

2023-05-08 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-05-08T11:14:33-07:00 New Revision: 96bc78631f16fe5ce2e7e6000b74d790b32f7a16 URL: https://github.com/llvm/llvm-project/commit/96bc78631f16fe5ce2e7e6000b74d790b32f7a16 DIFF: https://github.com/llvm/llvm-project/commit/96bc78631f16fe5ce2e7e6000b74d790b32f7a16.dif

[clang] 086183c - [Clang] Add check to Sema::AddAlignedAttr to verify active bits is not out of range

2023-06-08 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-06-08T13:53:33-07:00 New Revision: 086183c6c65fc8106b8cae99af95c4974b975f51 URL: https://github.com/llvm/llvm-project/commit/086183c6c65fc8106b8cae99af95c4974b975f51 DIFF: https://github.com/llvm/llvm-project/commit/086183c6c65fc8106b8cae99af95c4974b975f51.dif

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/82407 In 765d8a192180f8f33618087b15c022fe758044af we impelemented a fix for incorrect deletion of default constructors in unions. This fix missed a case and so this PR will extend the fix to cover the additional case.

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -9442,9 +9442,21 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( int DiagKind = -1; - if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted) -DiagKind = !Decl ? 0 : 1; - else if (SMOR.getKind() == Sema::SpecialMemberOverloadRe

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2393,6 +2391,17 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, Kind)) return false; } +} else if (!Constructor->isDelegatingConstructor()) { shafik wrote:

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, shafik wrote: I really don't like this name, I don't

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, +const CXXConstructorDecl *Constructor,

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2343,17 +2349,9 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, // - if the class is a union having variant members, exactly one of them // shall be initialized; shafik wrote: We need add a reference to [cwg2424]

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, +const CXXConstructorDecl *Constructor,

[clang] [clang] [SemaCXX] Disallow deducing "this" on operator `new` and `delete` (PR #82251)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, thanks for submitting a fix. https://github.com/llvm/llvm-project/pull/82251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix assert when transforming a pack indexing type. (PR #82234)

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

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
@@ -1760,6 +1760,21 @@ class BuiltinTemplateDecl : public TemplateDecl { BuiltinTemplateKind getBuiltinTemplateKind() const { return BTK; } }; +/// Provides information about an explicit instantiation of a variable or class +/// template. +struct ExplicitInstantiationInfo {

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
@@ -1760,6 +1760,21 @@ class BuiltinTemplateDecl : public TemplateDecl { BuiltinTemplateKind getBuiltinTemplateKind() const { return BTK; } }; +/// Provides information about an explicit instantiation of a variable or class +/// template. +struct ExplicitInstantiationInfo {

<    1   2   3   4   5   6   7   8   9   10   >