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

2024-01-04 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: https://github.com/erichkeane commented: Hopefully someone with more knowledge of the const evaluator (@shafik and @tbaederr have experience lately!) can poke their head in, but a few things from my look ove

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

2024-01-04 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -10895,6 +10899,132 @@ bool VectorExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { return Success(APValue(ResultElements.data(), ResultElements.size()), E); } +static bool

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

2024-01-04 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -0,0 +1,99 @@ +// RUN: %clang_cc1 -verify -std=c++2a -fsyntax-only %s +// expected-no-diagnostics + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ erichkeane wrote: Can we

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 1 issue with the test, else LGTM. https://github.com/llvm/llvm-project/pull/75883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/75883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
@@ -163,6 +170,40 @@ void attribute_const() { std::as_const(n); // expected-warning {{ignoring return value}} } +struct D { + void* operator new(__SIZE_TYPE__, D&&(*)(D&)); + void* operator new(__SIZE_TYPE__, D*(*)(D&)); + void* operator new(__SIZE_TYPE__, const D&(*)(D&)

[clang] [clang] Add per-global code model attribute (PR #72078)

2024-01-04 Thread Erich Keane via cfe-commits
@@ -3369,6 +3369,36 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) { } } +static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + StringRef CM; + StringRef Str; + SourceLocation LiteralLoc; + bool Ok = false; + // Check tha

[clang-tools-extra] [clang] Reapply "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations" (#76876) (PR #76915)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/76915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix the instantiation of return type requirements in lambda bodies (PR #76967)

2024-01-04 Thread Erich Keane via cfe-commits
@@ -843,6 +843,9 @@ Bug Fixes to C++ Support - Fix crash when parsing nested requirement. Fixes: (`#73112 `_) +- Fixed a crash caused by using return type requirement in a lambda. Fixes: + (`#64607

[clang] [Clang] Fix the instantiation of return type requirements in lambda bodies (PR #76967)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This is a not-awful way of solving this until we stop instantiating the body of the lambda. Could you please comment to that effect in TransformLambdaBody? Also would like @cor3ntin to take a look as well, else i'm ok with this. https://github.com/llvm

[clang] [Clang] Fix the instantiation of return type requirements in lambda bodies (PR #76967)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/76967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix the instantiation of return type requirements in lambda bodies (PR #76967)

2024-01-04 Thread Erich Keane via cfe-commits
erichkeane wrote: I'm still ok with it as-is, but would like @cor3ntin to take a run/do the approval. https://github.com/llvm/llvm-project/pull/76967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/75883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
@@ -130,27 +137,24 @@ C &&(&rMove)(C&) = std::move; // #8 expected-note {{instantiation of}} C &&(&rForward)(C&) = std::forward; // #9 expected-note {{instantiation of}} int (&rUnrelatedMove)(B, B) = std::move; -#if __cplusplus <= 201703L -// expected-warning@#1 {{non-address

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
@@ -130,27 +137,24 @@ C &&(&rMove)(C&) = std::move; // #8 expected-note {{instantiation of}} C &&(&rForward)(C&) = std::forward; // #9 expected-note {{instantiation of}} int (&rUnrelatedMove)(B, B) = std::move; -#if __cplusplus <= 201703L -// expected-warning@#1 {{non-address

[clang] [Clang] Support MSPropertyRefExpr as placement arg to new-expression (PR #75883)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/75883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/77002 A simple clause that is permitted on a few different constructs, 'default' takes a required parameter of either 'none' or 'present'. This patch implements parsing for it. >From d9f62a6d6b5a66a2e425f5c33f18

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -291,13 +307,63 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) { return DirKind; } +bool ClauseHasRequiredParens(OpenACCClauseKind Kind) { + return Kind == OpenACCClauseKind::Default; +} + +bool ParseOpenACCClauseParams(Parser &P, OpenACCClauseKind Kind) {

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77002 >From d9f62a6d6b5a66a2e425f5c33f18c4a13c8b88ca Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 4 Jan 2024 12:19:00 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'default' clause parsing. A simple clause

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -291,13 +307,63 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) { return DirKind; } +bool ClauseHasRequiredParens(OpenACCClauseKind Kind) { + return Kind == OpenACCClauseKind::Default; +} + +bool ParseOpenACCClauseParams(Parser &P, OpenACCClauseKind Kind) {

[clang] [clang] Add per-global code model attribute (PR #72078)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/72078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang]Transform uninstantiated ExceptionSpec in `TemplateInstantiator` (PR #77073)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/77073 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77002 >From d9f62a6d6b5a66a2e425f5c33f18c4a13c8b88ca Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 4 Jan 2024 12:19:00 -0800 Subject: [PATCH 1/3] [OpenACC] Implement 'default' clause parsing. A simple clause

[clang] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -291,13 +307,63 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) { return DirKind; } +bool ClauseHasRequiredParens(OpenACCClauseKind Kind) { + return Kind == OpenACCClauseKind::Default; +} + +bool ParseOpenACCClauseParams(Parser &P, OpenACCClauseKind Kind) {

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Erich Keane via cfe-commits
erichkeane wrote: So these sort of crashes are simply that the generated Multi-level Template Argument List doesn't match what is in the AST. This function (getInstantiationArgs) tries to 'recreate' them, so if it is 'wrong' than we get a crash. I suspect we're just missing some sort of awkw

[flang] [libcxx] [clang] [compiler-rt] [libc] [clang-tools-extra] [llvm] [lld] [lldb] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77002 >From d9f62a6d6b5a66a2e425f5c33f18c4a13c8b88ca Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 4 Jan 2024 12:19:00 -0800 Subject: [PATCH 1/3] [OpenACC] Implement 'default' clause parsing. A simple clause

[lld] [libc] [lldb] [compiler-rt] [flang] [clang] [llvm] [clang-tools-extra] [libcxx] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77002 >From d9f62a6d6b5a66a2e425f5c33f18c4a13c8b88ca Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 4 Jan 2024 12:19:00 -0800 Subject: [PATCH 1/4] [OpenACC] Implement 'default' clause parsing. A simple clause

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Erich Keane via cfe-commits
erichkeane wrote: > Thank you for the feedback. > > > I wouldn't be surprised if it is now being used in situations where the > > decl-context hasn't been appropriately updated > > I think this is not the case where we’re dealing with ill-formed > Decl-contexts; it is that the caller site doe

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -6,20 +6,20 @@ struct A { }; static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5}); -static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libc] [lld] [llvm] [lldb] [clang] [clang-tools-extra] [compiler-rt] [flang] [libcxx] [OpenACC] Implement 'default' clause parsing. (PR #77002)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/77002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Clean up -Wc++11-narrowing-const-reference code after #76094. NFC (PR #77278)

2024-01-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. thanks for this! https://github.com/llvm/llvm-project/pull/77278 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang] Fix IsOverload for function templates (PR #77323)

2024-01-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Seems fine to me, I don't see any reason that anything in the middle would cause a problem, so moving this is fine. https://github.com/llvm/llvm-project/pull/77323 ___ cfe-commits mailing lis

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
erichkeane wrote: Can you update https://clang.llvm.org/docs/InternalsManual.html#verifying-diagnostics as well please? It should be in-repo, but we should make sure that keeps up to date here. Else, LGTM, thanks! https://github.com/llvm/llvm-project/pull/77326 _

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -157,3 +157,33 @@ unexpected b; // expected-error@33 1-1 {{unknown type}} // what-error {{huh?}} // CHECK9: error: 'what-error' diagnostics expected but not seen: #endif + +#ifdef TEST_WIDE_DELIM +// RUN: not %clang_cc1 -DTEST_WIDE_DELIM -verify %s 2>&1 | FileCheck -check-p

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -3458,8 +3461,34 @@ A range can also be specified by ``-``. For example: In this example, the diagnostic may appear only once, if at all. +.. _DiagnosticMatching: + +Matching Modes +~~ + +The default matching mode is simple string, which looks for the expected

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -157,3 +157,33 @@ unexpected b; // expected-error@33 1-1 {{unknown type}} // what-error {{huh?}} // CHECK9: error: 'what-error' diagnostics expected but not seen: #endif + +#ifdef TEST_WIDE_DELIM +// RUN: not %clang_cc1 -DTEST_WIDE_DELIM -verify %s 2>&1 | FileCheck -check-p

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -157,3 +157,33 @@ unexpected b; // expected-error@33 1-1 {{unknown type}} // what-error {{huh?}} // CHECK9: error: 'what-error' diagnostics expected but not seen: #endif + +#ifdef TEST_WIDE_DELIM +// RUN: not %clang_cc1 -DTEST_WIDE_DELIM -verify %s 2>&1 | FileCheck -check-p

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -3458,8 +3461,34 @@ A range can also be specified by ``-``. For example: In this example, the diagnostic may appear only once, if at all. +.. _DiagnosticMatching: + +Matching Modes +~~ + +The default matching mode is simple string, which looks for the expected

[clang] [llvm] New calling convention preserve_none (PR #76868)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -2868,6 +2868,11 @@ def M68kRTD: DeclOrTypeAttr { let Documentation = [M68kRTDDocs]; } +def PreserveNone : DeclOrTypeAttr { + let Spellings = [Clang<"preserve_none">]; erichkeane wrote: This should have a subjectlist set, since this is on functions, it

[llvm] [clang] New calling convention preserve_none (PR #76868)

2024-01-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/76868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] New calling convention preserve_none (PR #76868)

2024-01-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: CFE changes aren't bad, just a few comments on how the attribute is defined in attr.td https://github.com/llvm/llvm-project/pull/76868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/77326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-09 Thread Erich Keane via cfe-commits
erichkeane wrote: > I think I've followed all the steps in > https://llvm.org/docs/GitHub.html#landing-your-change except performing the > actual merge (or squash), for which I lack write permissions. Is there > anything else for me to do here? Nope! I'll put this on my list to merge when te

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -284,6 +284,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, case Type::FunctionNoProto: case Type::Paren: case Type::PackExpansion: + erichkeane wrote: unrelated change? https://github.com/llvm/llvm-project/pull/72644

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/72644 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A LOT of stuff here... probably going to need a few more cycles on this to completely grok it. I didn't spend much time on tests, but would love if we could come up with some 'common patterns' (particularly any that others have sent you as a 'look at t

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1713,6 +1716,11 @@ class ASTContext : public RefCountedBase { /// C++11 decltype. QualType getDecltypeType(Expr *e, QualType UnderlyingType) const; + QualType getPackIndexingType(QualType Pattern, Expr *IndexExpr, + bool FullyExpanded = f

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1685,7 +1685,12 @@ enum CXCursorKind { */ CXCursor_CXXParenListInitExpr = 155, - CXCursor_LastExpr = CXCursor_CXXParenListInitExpr, + /** + * Represents a C++26 pack indexing expression erichkeane wrote: ```suggestion * Represents a C++26 pa

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -4884,6 +4884,72 @@ class DependentDecltypeType : public DecltypeType, public llvm::FoldingSetNode { Expr *E); }; +class PackIndexingType final +: public Type, + public llvm::FoldingSetNode, + private llvm::TrailingObjects { + friend Tr

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -836,6 +836,8 @@ ANNOTATION(primary_expr) // annotation for a primary expression, used when // message send ANNOTATION(decltype) // annotation for a decltype expression, // e.g., "decltype(foo.bar())" +ANNOTATION(indexed

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1061,6 +1070,59 @@ ExprResult Sema::ActOnSizeofParameterPackExpr(Scope *S, RParenLoc); } +static bool isParameterPack(Expr *PackExpression) { + if (auto D = dyn_cast(PackExpression); D) { +ValueDecl *VD = D->getDecl(); +return VD->i

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -309,6 +309,7 @@ class DeclSpec { static const TST TST_typeof_unqualExpr = clang::TST_typeof_unqualExpr; static const TST TST_decltype = clang::TST_decltype; static const TST TST_decltype_auto = clang::TST_decltype_auto; + static const TST TST_indexed_typename_pack =

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -4344,6 +4344,112 @@ class SizeOfPackExpr final } }; +class PackIndexingExpr final +: public Expr, + private llvm::TrailingObjects { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend TrailingObjects; + + SourceLocation EllipsisLoc; + + //

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -6460,6 +6476,100 @@ QualType TreeTransform::TransformDecltypeType(TypeLocBuilder &TLB, return Result; } +template +QualType +TreeTransform::TransformPackIndexingType(TypeLocBuilder &TLB, + PackIndexingTypeLoc TL) { + //

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1061,6 +1070,59 @@ ExprResult Sema::ActOnSizeofParameterPackExpr(Scope *S, RParenLoc); } +static bool isParameterPack(Expr *PackExpression) { + if (auto D = dyn_cast(PackExpression); D) { erichkeane wrote: ```suggestion

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const { getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]); } +PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) { } else { break; } + // Pack indexing + if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) && erichkeane wrote: While I think allowing thi

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1884,6 +1884,10 @@ class Parser : public CodeCompletionHandler { // C++ Expressions ExprResult tryParseCXXIdExpression(CXXScopeSpec &SS, bool isAddressOfOperand, Token &Replacement); + + ExprResult tryParseCXXPackIndexingExpression(

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const { getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]); } +PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const { getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]); } +PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -5697,6 +5698,39 @@ QualType ASTContext::getDecltypeType(Expr *e, QualType UnderlyingType) const { return QualType(dt, 0); } +QualType ASTContext::getPackIndexingType(QualType Pattern, Expr *IndexExpr, + bool FullyExpanded, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1067,6 +1067,17 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind, // where the syntax forbids a type. const Token &Next = NextToken(); + if (getLangOpts().CPlusPlus26 && Next.is(tok::ellipsis) && erichkeane wrote: Same s

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/77326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add tests for CWG1800-1804 (PR #77509)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -1,16 +1,169 @@ -// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected,cxx98 -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected,cxx11-17,since-cx

[clang] [clang] Add tests for CWG1800-1804 (PR #77509)

2024-01-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/77509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor `clang/test/SemaCXX/type-traits.cpp` to use modern `static_assert` (PR #77584)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -2671,212 +2660,212 @@ struct has_unique_object_representations { static const bool value = __has_unique_object_representations(T); }; erichkeane wrote: The intent here was to emulate how the library would use the builtin as a type-trait. Also, see thi

[clang] [clang]not lookup name containing a dependent type (PR #77587)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note, else LGTM. https://github.com/llvm/llvm-project/pull/77587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -5697,6 +5698,39 @@ QualType ASTContext::getDecltypeType(Expr *e, QualType UnderlyingType) const { return QualType(dt, 0); } +QualType ASTContext::getPackIndexingType(QualType Pattern, Expr *IndexExpr, + bool FullyExpanded, +

[clang] [clang][NFC] Refactor `clang/test/SemaCXX/type-traits.cpp` to use modern `static_assert` (PR #77584)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -2671,212 +2660,212 @@ struct has_unique_object_representations { static const bool value = __has_unique_object_representations(T); }; erichkeane wrote: Yep, thats true too, it was the intent at the time though (and to better emulate hte test cases we wer

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) { } else { break; } + // Pack indexing + if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) && erichkeane wrote: I'd suggested offline that

[clang] [OpenACC] Implement 'var' parsing correctly, support array sections (PR #77617)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/77617 While investigating implementing 'var-list' generically for the variety of clauses that support this syntax (an extensive list!) I discovered that it includes 'compound types' and members of compound types, a

[clang] [OpenACC] Implement 'var' parsing correctly, support array sections (PR #77617)

2024-01-10 Thread Erich Keane via cfe-commits
erichkeane wrote: @alexey-bataev : In particular I'd like to make you aware of what I've done here, since this is similar to the work you've done before/will affect it. It is currently my thought to make the OMPArraySectionExpr type a generic 'ArraySectionExpr' type in the not-so-distant futu

[clang] [OpenACC] Implement 'var' parsing correctly, support array sections (PR #77617)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/77617 >From d38a6b7ac88d2e97eaf2f479b01be00e042d545b Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 9 Jan 2024 15:13:38 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'var' parsing correctly, support array se

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) { } else { break; } + // Pack indexing + if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) && erichkeane wrote: Would a change like that b

[clang] [OpenACC] Implement 'var' parsing correctly, support array sections (PR #77617)

2024-01-10 Thread Erich Keane via cfe-commits
erichkeane wrote: > > @alexey-bataev : In particular I'd like to make you aware of what I've done > > here, since this is similar to the work you've done before/will affect it. > > It is currently my thought to make the OMPArraySectionExpr type a generic > > 'ArraySectionExpr' type in the not-

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,CXX98 +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -f

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/77637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: The test should also validate the non-catch case! The destruction order is also relevant for the 'try' block's cleanup as well. So there is probably two different 'check' sections here that need to happen. https://github.com/llvm/llvm-project/pull/776

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane Defect report reads > > > The destruction of fully-constructed array elements when array > > initialization is terminated by an exception is required by 14.3 > > [[except.ctor](https://wg21.link/except.ctor#2)] paragraph 2, but the order > > in which they are t

[clang] [OpenACC] Implement 'var' parsing correctly, support array sections (PR #77617)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/77617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,CXX98 +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -f

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,CXX98 +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -f

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
@@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,CXX98 +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -f

[clang] [clang] Add test for CWG1807 (PR #77637)

2024-01-10 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/77637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] New calling convention preserve_none (PR #76868)

2024-01-11 Thread Erich Keane via cfe-commits
@@ -2868,6 +2868,11 @@ def M68kRTD: DeclOrTypeAttr { let Documentation = [M68kRTDDocs]; } +def PreserveNone : DeclOrTypeAttr { + let Spellings = [Clang<"preserve_none">]; erichkeane wrote: The second example there is a function pointer, not a function you'

[clang] [Clang] Allow the use of consecutive brackets as an extension in C++03 (PR #75148)

2024-01-11 Thread Erich Keane via cfe-commits
@@ -815,8 +815,8 @@ def err_unexpected_template_in_destructor_name : Error< "'template' keyword not permitted in destructor name">; def err_unexpected_template_after_using : Error< "'template' keyword not permitted after 'using' keyword">; -def err_two_right_angle_brackets_

[clang] [libunwind] [llvm] [lld] [flang] [libc] [mlir] [libcxx] [lldb] [compiler-rt] [libcxxabi] [clang-tools-extra] [clang] static operators should evaluate object argument (PR #68485)

2024-01-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > LGTM @erichkeane you want to look at that? I'd looked at it a while back, and just did another scroll, happy as-is. https://github.com/llvm/llvm-project/pull/68485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] 2f20743 - Deferred Concept Instantiation Implementation

2022-06-30 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-06-30T06:47:11-07:00 New Revision: 2f207439521d62d9551b2884158368e8b34084e5 URL: https://github.com/llvm/llvm-project/commit/2f207439521d62d9551b2884158368e8b34084e5 DIFF: https://github.com/llvm/llvm-project/commit/2f207439521d62d9551b2884158368e8b34084e5.diff L

[clang] befa8cf - Re-apply "Deferred Concept Instantiation Implementation""

2022-07-01 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-07-01T06:51:38-07:00 New Revision: befa8cf087dbb8159a4d9dc8fa4d6748d6d5049a URL: https://github.com/llvm/llvm-project/commit/befa8cf087dbb8159a4d9dc8fa4d6748d6d5049a DIFF: https://github.com/llvm/llvm-project/commit/befa8cf087dbb8159a4d9dc8fa4d6748d6d5049a.diff L

[clang] 258c3ae - Revert "Re-apply "Deferred Concept Instantiation Implementation"""

2022-07-01 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-07-01T11:20:16-07:00 New Revision: 258c3aee54e11bc5c5d8ac137eb15e8d5bbcc7e4 URL: https://github.com/llvm/llvm-project/commit/258c3aee54e11bc5c5d8ac137eb15e8d5bbcc7e4 DIFF: https://github.com/llvm/llvm-project/commit/258c3aee54e11bc5c5d8ac137eb15e8d5bbcc7e4.diff L

[clang] 3fb101a - [NFC] Replace a not-null-check && isa with isa_and_nonnull

2022-03-23 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-03-23T13:09:28-07:00 New Revision: 3fb101a6914b6d0e7a46b425eeafc44578d7ff78 URL: https://github.com/llvm/llvm-project/commit/3fb101a6914b6d0e7a46b425eeafc44578d7ff78 DIFF: https://github.com/llvm/llvm-project/commit/3fb101a6914b6d0e7a46b425eeafc44578d7ff78.diff L

[clang] 7faa956 - [clang][CodeGen]Fix clang crash and add bitfield support in __builtin_dump_struct

2022-03-24 Thread Erich Keane via cfe-commits
Author: wangyihan Date: 2022-03-24T12:23:29-07:00 New Revision: 7faa95624eb3a01b75ccc391f32768ba70b3b630 URL: https://github.com/llvm/llvm-project/commit/7faa95624eb3a01b75ccc391f32768ba70b3b630 DIFF: https://github.com/llvm/llvm-project/commit/7faa95624eb3a01b75ccc391f32768ba70b3b630.diff LOG

[clang] 281b7ee - Update www_status/add test for P1972:

2022-03-28 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-03-28T06:31:04-07:00 New Revision: 281b7eeb149d236dd4f2c1ab976cce361de4e057 URL: https://github.com/llvm/llvm-project/commit/281b7eeb149d236dd4f2c1ab976cce361de4e057 DIFF: https://github.com/llvm/llvm-project/commit/281b7eeb149d236dd4f2c1ab976cce361de4e057.diff L

[clang] 6c32075 - [Clang][doc][NFC]Remove duplicate items in ReleaseNotes

2022-03-29 Thread Erich Keane via cfe-commits
Author: wangyihan Date: 2022-03-29T10:30:34-07:00 New Revision: 6c32075d29d4fe3985aa8a98b23c33902190a15d URL: https://github.com/llvm/llvm-project/commit/6c32075d29d4fe3985aa8a98b23c33902190a15d DIFF: https://github.com/llvm/llvm-project/commit/6c32075d29d4fe3985aa8a98b23c33902190a15d.diff LOG

[clang] de7cd3c - [Clang][CodeGen]Remove anonymous tag locations

2022-03-29 Thread Erich Keane via cfe-commits
Author: wangyihan Date: 2022-03-29T11:38:29-07:00 New Revision: de7cd3ccf563847a24e04fb920cd0e3c310ba5bd URL: https://github.com/llvm/llvm-project/commit/de7cd3ccf563847a24e04fb920cd0e3c310ba5bd DIFF: https://github.com/llvm/llvm-project/commit/de7cd3ccf563847a24e04fb920cd0e3c310ba5bd.diff LOG

[clang] 4cf98f9 - [GH54588]Fix ItaniumMangler for NTTP unnamed unions w/ unnamed structs

2022-04-01 Thread Erich Keane via cfe-commits
Author: Erich Keane Date: 2022-04-01T11:31:14-07:00 New Revision: 4cf98f973a13c5049322abff43f0dff3c214311b URL: https://github.com/llvm/llvm-project/commit/4cf98f973a13c5049322abff43f0dff3c214311b DIFF: https://github.com/llvm/llvm-project/commit/4cf98f973a13c5049322abff43f0dff3c214311b.diff L

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