r345784 - Revert "[ASTImporter][Structural Eq] Check for isBeingDefined"

2018-10-31 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Wed Oct 31 14:53:15 2018 New Revision: 345784 URL: http://llvm.org/viewvc/llvm-project?rev=345784=rev Log: Revert "[ASTImporter][Structural Eq] Check for isBeingDefined" This reverts commit r345760 because it caused an assertion in the lldb test suite. This is the log from

r357100 - [ASTImporter] Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it

2019-03-27 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Wed Mar 27 10:47:36 2019 New Revision: 357100 URL: http://llvm.org/viewvc/llvm-project?rev=357100=rev Log: [ASTImporter] Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it Summary: We may try and re-import an

r355332 - [ASTImporter] Handle built-in when importing SourceLocation and FileID

2019-03-04 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Mar 4 12:25:54 2019 New Revision: 355332 URL: http://llvm.org/viewvc/llvm-project?rev=355332=rev Log: [ASTImporter] Handle built-in when importing SourceLocation and FileID Summary: Currently when we see a built-in we try and import the include location. Instead what

r352436 - [ASTImporter] Fix handling of overriden methods during ASTImport

2019-01-28 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Jan 28 13:55:33 2019 New Revision: 352436 URL: http://llvm.org/viewvc/llvm-project?rev=352436=rev Log: [ASTImporter] Fix handling of overriden methods during ASTImport Summary: When importing classes we may add a CXXMethodDecl more than once to a CXXRecordDecl when

r357940 - [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName

2019-04-08 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Apr 8 13:50:21 2019 New Revision: 357940 URL: http://llvm.org/viewvc/llvm-project?rev=357940=rev Log: [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error handling

r361650 - [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name instead of SearchName

2019-05-24 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Fri May 24 09:53:44 2019 New Revision: 361650 URL: http://llvm.org/viewvc/llvm-project?rev=361650=rev Log: [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error

r359338 - [ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition

2019-04-26 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Fri Apr 26 11:51:28 2019 New Revision: 359338 URL: http://llvm.org/viewvc/llvm-project?rev=359338=rev Log: [ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition Summary: For a CXXRecordDecl the RecordDeclBits are stored in the

r368591 - [ASTDump] Add is_anonymous to VisitCXXRecordDecl

2019-08-12 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Aug 12 10:07:49 2019 New Revision: 368591 URL: http://llvm.org/viewvc/llvm-project?rev=368591=rev Log: [ASTDump] Add is_anonymous to VisitCXXRecordDecl Summary: Adding is_anonymous the ASTDump for CXXRecordDecl. This turned out to be useful when debugging some problems

r370107 - Debug Info: Support for DW_AT_export_symbols for anonymous structs

2019-08-27 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Tue Aug 27 13:17:35 2019 New Revision: 370107 URL: http://llvm.org/viewvc/llvm-project?rev=370107=rev Log: Debug Info: Support for DW_AT_export_symbols for anonymous structs This implements the DWARF 5 feature described in: http://dwarfstd.org/ShowIssue.php?issue=141212.1

[clang] f56cb52 - [DEBUGINFO] [LLDB] Add support for generating debug-info for structured bindings of structs and arrays

2022-02-17 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-02-17T11:14:14-08:00 New Revision: f56cb520d8554ca42a215e82ecfa58d0b6c178e4 URL: https://github.com/llvm/llvm-project/commit/f56cb520d8554ca42a215e82ecfa58d0b6c178e4 DIFF:

[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 << " "; //

[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] 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

[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,

[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

[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

[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 ) { 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 ) { 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 ) { if (!isa(FTD->getDeclContext())) { NestedNameSpecifier *NNS = FTD->getTemplatedDecl()->getQualifier(); -

[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

[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 , BinaryOperator *E, return false; IntRange OtherValueRange = GetExprRange( - S.Context, Other, S.isConstantEvaluated(), /*Approximate*/ false); + S.Context, Other,

[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 , BinaryOperator *E, return false; IntRange OtherValueRange = GetExprRange( - S.Context, Other, S.isConstantEvaluated(), /*Approximate*/ false); + S.Context, Other,

[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] 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 , Expr *E, QualType T, IntRange SourceTypeRange = IntRange::forTargetOfCanonicalType(S.Context, Source); - IntRange LikelySourceRange = - GetExprRange(S.Context, E, S.isConstantEvaluated(),

[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 , 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
@@ -15090,8 +15093,9 @@ static void CheckImplicitConversion(Sema , 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
@@ -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] 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:

[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

[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] 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

[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] 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:

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

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

[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

[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] 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

[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] [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

[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
@@ -14043,28 +14039,61 @@ static bool CheckTautologicalComparison(Sema , 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 , FieldDecl *Bitfield, Expr *Init, /// Analyze the given simple or compound assignment for warning-worthy /// operations. -static void AnalyzeAssignment(Sema , BinaryOperator *E) { +void

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

2023-09-08 Thread Shafik Yaghmour via cfe-commits
@@ -14135,8 +14164,8 @@ static void AnalyzeComparison(Sema , 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()); -

[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
@@ -14308,22 +14382,22 @@ static bool AnalyzeBitFieldAssignment(Sema , FieldDecl *Bitfield, Expr *Init, /// Analyze the given simple or compound assignment for warning-worthy /// operations. -static void AnalyzeAssignment(Sema , BinaryOperator *E) { +void

[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 +

[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}); +

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

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

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

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

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

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

[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

[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}); +

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

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

[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}); +

[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

[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] [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] 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:

[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] [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] Mark declarators invalid in the presence of ill-formed explicit parameters. (PR #70018)

2023-10-26 Thread Shafik Yaghmour via cfe-commits
@@ -542,3 +542,46 @@ void foo(C c) { } } + + +namespace GH69838 { +struct S { + S(this auto ) {} // expected-error {{an explicit object parameter cannot appear in a constructor}} + virtual void f(this S self) {} // expected-error {{an explicit object parameter cannot

[clang] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The clang-format error is a false positive. https://github.com/llvm/llvm-project/pull/70150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The clang-format error is a false positive. https://github.com/llvm/llvm-project/pull/70150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

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

[clang] [clang] Enable Wenum-constexpr-conversion also in system headers and … (PR #67528)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?= Message-ID: In-Reply-To: shafik wrote: Thank you for doing this work. https://github.com/llvm/llvm-project/pull/67528 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: @@ -1299,8 +1299,9 @@ static bool checkTupleLikeDecomposition(Sema , // in the associated namespaces. Expr *Get = UnresolvedLookupExpr::Create( S.Context, nullptr, NestedNameSpecifierLoc(),

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/shafik commented: A couple of nitpicks https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: @@ -354,10 +354,10 @@ UnresolvedLookupExpr::UnresolvedLookupExpr( NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo , bool RequiresADL, bool Overloaded, const

[clang] [clang] Handle templated operators with reversed arguments (PR #69595)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -7688,7 +7688,7 @@ bool Sema::CheckNonDependentConversions( QualType ParamType = ParamTypes[I + Offset]; if (!ParamType->isDependentType()) { unsigned ConvIdx = PO == OverloadCandidateParamOrder::Reversed - ? 0 +

[clang-tools-extra] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

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

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: You need to make sure you tests have newlines at the end https://github.com/llvm/llvm-project/pull/69061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s + +void t1(void) { + int array[1] = { 0 }; + char subscript = 0; + int val = array[subscript]; // expected-warning{{array subscript is of type 'char'}} +} + +void t2(void) { + int array[1] = { 0

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

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

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -15604,10 +15604,13 @@ bool Expr::EvaluateAsInitializer(APValue , const ASTContext , LValue LVal; LVal.set(VD); -if (!EvaluateInPlace(Value, Info, LVal, this, - /*AllowNonLiteralTypes=*/true) || -EStatus.HasSideEffects) -

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > While the change itself looks neat, I am curious about the reason how this > interact with modules. IIUC modules is incidental to the problem, it is just a way we run into an underlying issue that we are not dealing with full-expressions properly in this case.

[clang] [clang] Bail out if the result of function template instantiation is not a function type. (PR #69459)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please next time add a detailed description to your PR. This is key for reviewers to fully understand at a glance what the fix is for. This is also key for users of git log to be able to understand changes at a glance without having to dig in. Folks often use git log to track

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I think this change makes sense but I am not crazy about how we deal w/ full-expressions right now with these `FullExpressionRAII`, it feels very ad-hoc and it takes a bunch of time to understand why they are needed where they are.

[clang] [clang] Bail out if the result of function template instantiation is not a function type. (PR #69459)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -x c++ -std=c++14 -fsyntax-only -verify %s + +template +using Type = typename A::NestedType; // expected-error {{type 'float' cannot be used prior to '::' because it has no members}} + +template +void Func() { + using MyType = Type(); //

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please make sure you write a more complete description of the problem and why this solves the problem. The description is usually what goes into the git log and that is very useful for quickly understanding commits and tracking down problems. I know some folks edit the

[clang] [Clang][Sema] Skip RecordDecl when checking scope of declarations (PR #69432)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -19,4 +19,8 @@ void f2(void) { struct U u; } - +void f3(void) { shafik wrote: So unlike the original test case this one does not seem to cause a crash. Can we add a test case for that as well to verify we are fixing that issue as well.

[clang] [clang] Language to String function (PR #69487)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: What is the intended use for this? https://github.com/llvm/llvm-project/pull/69487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -585,3 +585,34 @@ class Server : public Thing { S name_; }; } + +namespace GH69233 { +struct Base {}; +struct S : Base { +int j; +S& operator=(this Base& self, const S&) = default; +// expected-warning@-1 {{explicitly defaulted copy assignment operator is

[clang] [clang] Emit bad shift warnings (PR #70307)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -11773,7 +11786,25 @@ QualType Sema::CheckShiftOperands(ExprResult , ExprResult , isScopedEnumerationType(RHSType)) { return InvalidOperands(Loc, LHS, RHS); } - DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType); + + BadShiftValueKind BSVKind = +

[clang] [NFC][Clang] Fix potential deref of end iterator (PR #70193)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -65,7 +65,7 @@ class CXXFieldCollector { /// getCurFields - Pointer to array of fields added to the currently parsed /// class. - FieldDecl **getCurFields() { return &*(Fields.end() - getCurNumFields()); } shafik wrote: I think this is basically

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-31 Thread Shafik Yaghmour via cfe-commits
@@ -3553,6 +3553,48 @@ static unsigned getPackIndexForParam(Sema , llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl`, +// we'll try to instantiate and update its explicit

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

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

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. I just want to make sure we have enough testing in place for this change but overall I think I am happy. https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing list

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -3553,6 +3553,49 @@ static unsigned getPackIndexForParam(Sema , llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifier

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -3682,6 +3725,17 @@ Sema::TemplateDeductionResult Sema::FinishTemplateArgumentDeduction( } } + // We skipped the instantiation of the explicit-specifier during subst the shafik wrote: This sentence is not super clear, can we spell out `subst` and

[clang] [CodeGen] Revamp counted_by calculations (PR #70606)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
@@ -966,9 +962,65 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction , return nullptr; } -FieldDecl *CodeGenFunction::FindCountedByField( -const Expr *Base, -LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel) { +const Expr *

[clang] [CodeGen] Revamp counted_by calculations (PR #70606)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
@@ -966,9 +962,65 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction , return nullptr; } -FieldDecl *CodeGenFunction::FindCountedByField( -const Expr *Base, -LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel) { +const Expr *

[clang] Fix to attribute plugins reaching an unreachable (PR #70877)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please add a more detailed description of the problem and what the fix actually is. The description is what ends up in the git log and it is important that we have enough details there to understand the PR and what changes it makes. I do not see a test, can this fix be

  1   2   3   4   5   6   >