[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-06 Thread Erich Keane via cfe-commits
erichkeane wrote: > Umm how could I resolve that? I tried various things but none working. 🥲 You'll have to spend some time in a debugger (note that `clang::DiagnosticIDs::EmitDiag` is where the diagnostic happens, so is a good place for a brekapoint). But I see that in your creation of your

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -9759,7 +9759,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, SmallVector TemplateParamLists; llvm::append_range(TemplateParamLists, TemplateParamListsRef); if (TemplateParameterList *Invented = D.getInventedTemplateParameterList()) { -

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -19294,7 +19294,16 @@ void Sema::ActOnStartFunctionDeclarationDeclarator( ExplicitLists, /*IsFriend=*/false, IsMemberSpecialization, IsInvalid, /*SuppressDiagnostic=*/true); } - if (ExplicitParams) { + // C++23 [dcl.fct]p23: + // An abbreviated functio

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -9759,7 +9759,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, SmallVector TemplateParamLists; llvm::append_range(TemplateParamLists, TemplateParamListsRef); if (TemplateParameterList *Invented = D.getInventedTemplateParameterList()) { -

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

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

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -380,7 +375,8 @@ class DeclSpec { unsigned FS_noreturn_specified : 1; // friend-specifier - unsigned Friend_specified : 1; + unsigned FriendSpecified : 1; erichkeane wrote: Should these have that debug-attribute that we added not long ago? I think i

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -145,6 +145,7 @@ Improvements to Clang's diagnostics prints. - Clang now diagnoses member template declarations with multiple declarators. +- Clang now diagnoses friend declarations with an ``enum`` elaborated-type-specifier outside of C++98. erichkeane

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -2552,10 +2552,10 @@ class Parser : public CodeCompletionHandler { /// Starting with a scope specifier, identifier, or /// template-id that refers to the current class, determine whether /// this is a constructor declarator. - bool isConstructorDeclarator( - bool

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -145,6 +145,7 @@ Improvements to Clang's diagnostics prints. - Clang now diagnoses member template declarations with multiple declarators. +- Clang now diagnoses friend declarations with an ``enum`` elaborated-type-specifier outside of C++98. erichkeane

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-06 Thread Erich Keane via cfe-commits
@@ -380,7 +375,8 @@ class DeclSpec { unsigned FS_noreturn_specified : 1; // friend-specifier - unsigned Friend_specified : 1; + unsigned FriendSpecified : 1; erichkeane wrote: I think you're right, thats the one! https://github.com/llvm/llvm-project/pu

[clang] [Clang][Sema] Do not attempt to instantiate a deleted move constructor (PR #80959)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -7894,13 +7895,18 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, if (ShouldDeleteForTypeMismatch || ShouldDeleteSpecialMember(MD, CSM)) { if (First) { SetDeclDeleted(MD, MD->getLocation()); - if (!inTemplateInstantiation() && !HadErr

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) { << NI.getName() << ParamTy << Ty; return; } + VarDecl *VD = cast(D); + // Create a reference to the variable declaration. This is a fake/dummy + // reference. + DeclR

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) { << NI.getName() << ParamTy << Ty; return; } + VarDecl *VD = cast(D); + // Create a reference to the variable declaration. This is a fake/dummy + // reference. + DeclR

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) { << NI.getName() << ParamTy << Ty; return; } + VarDecl *VD = cast(D); + // Create a reference to the variable declaration. This is a fake/dummy + // reference. + DeclR

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) { << NI.getName() << ParamTy << Ty; return; } + VarDecl *VD = cast(D); + // Create a reference to the variable declaration. This is a fake/dummy + // reference. + DeclR

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -4528,6 +4528,54 @@ static bool IsBuiltInOrStandardCXX11Attribute(IdentifierInfo *AttrName, } } +/// Parse the argument to C++23's [[assume()]] attribute. +bool Parser::ParseAssumeAttributeArg(ParsedAttributes &Attrs, erichkeane wrote: Hopefully someone

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -783,6 +783,9 @@ def err_ms_property_expected_comma_or_rparen : Error< def err_ms_property_initializer : Error< "property declaration cannot have a default member initializer">; +def err_assume_attr_expects_cond_expr : Error< + "use of this expression in an 'assume' attr

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -4528,6 +4528,54 @@ static bool IsBuiltInOrStandardCXX11Attribute(IdentifierInfo *AttrName, } } +/// Parse the argument to C++23's [[assume()]] attribute. +bool Parser::ParseAssumeAttributeArg(ParsedAttributes &Attrs, + IdentifierInfo

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
erichkeane wrote: Also note, we need to update the feature-test-macro/has_attribute-expr here. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > > We have 2 options: > > > > * Wait for llvm to get improve their handling of assumption based > > optimizations. > > * Proceed with this work hoping this encourages work on the optimizer. > > The standard also mentions that `__has_cpp_attribute` should return `0` ‘if > an

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I think the confusion/conflict between this and clang::assume needs to be > > figured out. These two should just be, as close as possible, spellings of > > the same thing. > > Well, apparently, `clang::assume` always takes a string and is meant for OMP > assumptions, so

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Should I fix the conflict in the release notes myself, or should that be done > when this gets merged? Because at least in my experience, merge conflicts in > the release notes just keep reappearing if a pr stays open for some time... Lets hang out on that for a bit... Unfo

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

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

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > We also need to figure out what to do w/ `clang::assume`, because the entire > situation with the two being separate attributes is a bit of a mess, as > @erichkeane also pointed out. That can probably be resolved separately from > the RFC, however—though I’m not that famili

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Looks like there is a test > (`clang-tools-extra/test/clang-tidy/infrastructure/diagnostic.cpp`) that > contains the following: > > ```c++ > #ifdef PR64602 // Should not crash > template > struct S > { > auto foo(auto); > }; > > template <> > auto S<>::foo(auto) > { >

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > We also need to figure out what to do w/ `clang::assume`, because the > > > entire situation with the two being separate attributes is a bit of a > > > mess, as @erichkeane also pointed out. That can probably be resolved > > > separately from the RFC, however—though I’m

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Looks like there is a test > (`clang-tools-extra/test/clang-tidy/infrastructure/diagnostic.cpp`) that > contains the following: > > ```c++ > #ifdef PR64602 // Should not crash > template > struct S > { > auto foo(auto); > }; > > template <> > auto S<>::foo(auto) > { >

[clang-tools-extra] [clang-tidy] Fix failing test after #80864 (PR #81171)

2024-02-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This seems right to me, though a 2nd reviewer would be nice. I don't think we should wait for CI on this due to it fixing a bot-breakage. https://github.com/llvm/llvm-project/pull/81171 ___ cf

[clang] Open acc ast start[OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/81188 'serial', 'parallel', and 'kernel' constructs are all considered 'Compute' constructs. This patch creates the AST type, plus the required infrastructure for such a type, plus some base types that will be useful

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

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

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-08 Thread Erich Keane via cfe-commits
@@ -2838,6 +2838,27 @@ void ASTStmtWriter::VisitOMPTargetParallelGenericLoopDirective( Code = serialization::STMT_OMP_TARGET_PARALLEL_GENERIC_LOOP_DIRECTIVE; } +//===--===// +// OpenACC Constructs/Directive

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-08 Thread Erich Keane via cfe-commits
@@ -0,0 +1,140 @@ +//===- StmtOpenACC.h - Classes for OpenACC directives --*- C++ -*-===// +// +// 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: Ap

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-08 Thread Erich Keane via cfe-commits
@@ -0,0 +1,140 @@ +//===- StmtOpenACC.h - Classes for OpenACC directives --*- C++ -*-===// +// +// 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: Ap

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) { << NI.getName() << ParamTy << Ty; return; } + VarDecl *VD = cast(D); + // Create a reference to the variable declaration. This is a fake/dummy + // reference. + DeclR

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Erich Keane via cfe-commits
erichkeane wrote: > cc @erichkeane @AaronBallman I looked through and don't see anything of concern to me that you haven't covered. I am on the fence as to whether this warning makes sense to have in this situation. The point of the warning isn't that the language has a problem, it is that

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/81188 >From b7ca554663c4d0994ac255ee17ac016ef94f6778 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 8 Feb 2024 07:56:30 -0800 Subject: [PATCH 1/3] [OpenACC] Implement AST for OpenACC Compute Constructs 'seria

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,142 @@ +//===- StmtOpenACC.h - Classes for OpenACC directives --*- C++ -*-===// +// +// 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: Ap

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -2145,7 +2145,11 @@ enum CXCursorKind { */ CXCursor_OMPScopeDirective = 306, - CXCursor_LastStmt = CXCursor_OMPScopeDirective, + /** OpenACC Compute Construct. + */ + CXCursor_OpenACCComputeConstruct = 307, erichkeane wrote: Thats a good idea, an

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/81188 >From b7ca554663c4d0994ac255ee17ac016ef94f6778 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 8 Feb 2024 07:56:30 -0800 Subject: [PATCH 1/4] [OpenACC] Implement AST for OpenACC Compute Constructs 'seria

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emi

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -O0 -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,142 @@ +//===- StmtOpenACC.h - Classes for OpenACC directives --*- C++ -*-===// +// +// 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: Ap

[clang] [clang] Add some CodeGen tests for CWG 1xx issues (PR #80338)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emi

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emi

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

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

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM, make sure @cor3ntin is happy too though. https://github.com/llvm/llvm-project/pull/80823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [clang] Add some CodeGen tests for CWG 2xx issues (PR #80823)

2024-02-09 Thread Erich Keane via cfe-commits
@@ -6,28 +6,36 @@ // RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -disable-llvm-passes -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK // RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -em

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

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

[clang] [clang][NFC] Refactor `Sema::TemplateDeductionResult` (PR #81398)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -33,6 +33,7 @@ namespace clang { class Decl; struct DeducedPack; class Sema; +enum class TemplateDeductionResult; erichkeane wrote: should we specify the underlying type in all of these? I wonder if we can just specify it as `uint8_t`? Would mean not hav

[clang] [clang][NFC] Refactor `Sema::TemplateDeductionResult` (PR #81398)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -11445,11 +11452,16 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, (ParamD = Param.dyn_cast()) || (ParamD = Param.dyn_cast()) || (ParamD = Param.dyn_cast()); - switch (DeductionFailure.Result) { - case Sema::TDK_Success: -llvm_un

[clang] Avoid printing overly large integer. (PR #75902)

2024-02-12 Thread Erich Keane via cfe-commits
=?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= ,Nhat Nguyen Message-ID: In-Reply-To: erichkeane wrote: Looks like all the tests disappeared? Only thing I see is the code change. Also, no release note is currently present. https://github.c

[clang] [clang] Support `__is_trivially_copyable(int()&)==false` (PR #81298)

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

[clang] [clang] Support `__is_trivially_copyable(int()&)==false` (PR #81298)

2024-02-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This would need a release note + I think it needs better testing. @AaronBallman might wish to take a look as well, this is his code ownership. https://github.com/llvm/llvm-project/pull/81298 ___ cfe-commits ma

[clang] [clang] Support `__is_trivially_copyable(int()&)==false` (PR #81298)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -57,7 +57,7 @@ UNION(char[2], short) u2 = { .one = { 'a', 'b' } }; // ext-warning 3 {{'_Static_ typedef UNION(char, short) U3; // expected-error {{static assertion failed due to requirement 'sizeof(char) == sizeof(short)': type size mismatch}} \

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -2031,6 +2031,13 @@ def AMDGPUNumVGPR : InheritableAttr { let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; } +def AMDGPUNumWorkGroups : InheritableAttr { + let Spellings = [Clang<"amdgpu_num_work_groups", 0>]; + let Args = [UnsignedArgument<"NumWor

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -2705,6 +2705,30 @@ An error will be given if: }]; } +def AMDGPUNumWorkGroupsDocs : Documentation { + let Category = DocCatAMDGPUAttributes; + let Content = [{ +The number of work groups specifies the number of work groups when the kernel +is dispatched. + +Clang suppor

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -2705,6 +2705,30 @@ An error will be given if: }]; } +def AMDGPUNumWorkGroupsDocs : Documentation { + let Category = DocCatAMDGPUAttributes; + let Content = [{ +The number of work groups specifies the number of work groups when the kernel erichkeane wro

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -2705,6 +2705,30 @@ An error will be given if: }]; } +def AMDGPUNumWorkGroupsDocs : Documentation { + let Category = DocCatAMDGPUAttributes; + let Content = [{ +The number of work groups specifies the number of work groups when the kernel +is dispatched. + +Clang suppor

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,25 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +static void handleAMDGPUNumWorkGroupsAttr(Sema &S, Decl *D, +

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -2705,6 +2705,30 @@ An error will be given if: }]; } +def AMDGPUNumWorkGroupsDocs : Documentation { + let Category = DocCatAMDGPUAttributes; + let Content = [{ +The number of work groups specifies the number of work groups when the kernel +is dispatched. + +Clang suppor

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -356,6 +356,19 @@ void AMDGPUTargetCodeGenInfo::setFunctionDeclAttributes( if (NumVGPR != 0) F->addFnAttr("amdgpu-num-vgpr", llvm::utostr(NumVGPR)); } + + if (const auto *Attr = FD->getAttr()) { +uint32_t X = Attr->getNumWorkGroupsX(); +uint32_t Y = Attr

[clang] [Clang][Sema] Don't consider top-level cv-qualifiers in template partial orderings (PR #81449)

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

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A few suggestions, but I REALLY would like @cor3ntin to take a final pass, it mostly LGTM. https://github.com/llvm/llvm-project/pull/80802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

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

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -1614,7 +1614,19 @@ bool TemplateInstantiator::AlreadyTransformed(QualType T) { if (T.isNull()) return true; - if (T->isInstantiationDependentType() || T->isVariablyModifiedType()) + bool DependentLambdaType = false; + QualType DesugaredType = T.getDesugaredType(S

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -1614,7 +1614,19 @@ bool TemplateInstantiator::AlreadyTransformed(QualType T) { if (T.isNull()) return true; - if (T->isInstantiationDependentType() || T->isVariablyModifiedType()) + bool DependentLambdaType = false; + QualType DesugaredType = T.getDesugaredType(S

[clang] [clang][NFC] Refactor `Sema::TemplateDeductionResult` (PR #81398)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -11445,11 +11452,16 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, (ParamD = Param.dyn_cast()) || (ParamD = Param.dyn_cast()) || (ParamD = Param.dyn_cast()); - switch (DeductionFailure.Result) { - case Sema::TDK_Success: -llvm_un

[clang] [clang][NFC] Refactor `Sema::TemplateDeductionResult` (PR #81398)

2024-02-12 Thread Erich Keane via cfe-commits
@@ -33,6 +33,7 @@ namespace clang { class Decl; struct DeducedPack; class Sema; +enum class TemplateDeductionResult; erichkeane wrote: Ok then, I'm ok sticking to our existing practice if this is a policy that was already made. https://github.com/llvm/llvm-p

[clang] [clang][NFC] Refactor `Sema::TemplateDeductionResult` (PR #81398)

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

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

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

[clang] [Clang][Sema] Diagnose declarative nested-name-specifiers naming alias templates (PR #80842)

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

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

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

[clang] [OpenACC] Implement AST for OpenACC Compute Constructs (PR #81188)

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

[clang] [Clang][Sema] fix crash in codegen stage when an lambda expression declared in an unevaluated context (PR #80802)

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

[clang] Avoid printing overly large integer. (PR #75902)

2024-02-13 Thread Erich Keane via cfe-commits
=?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= , =?utf-8?q?“Nhat?= ,Nhat Nguyen Message-ID: In-Reply-To: erichkeane wrote: > > Looks like all the tests disappeared? Only thing I see is the code change. > > Also, no release note is currently present. > > Hi I a

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-13 Thread Erich Keane via cfe-commits
@@ -2705,6 +2705,30 @@ An error will be given if: }]; } +def AMDGPUNumWorkGroupsDocs : Documentation { + let Category = DocCatAMDGPUAttributes; + let Content = [{ +The number of work groups specifies the number of work groups when the kernel +is dispatched. + +Clang suppor

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

2024-02-13 Thread Erich Keane via cfe-commits
erichkeane wrote: >The "most breaking" change is to AST Matchers, insofar that hasTypeLoc will no >longer match class template specializations (since they no longer store the >type as written). I wasn't entirely sure what to replace the tests for this >behavior with, so I just commented them o

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

2024-02-13 Thread Erich Keane via cfe-commits
@@ -2596,23 +2582,24 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -TypeSourc

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

2024-02-13 Thread Erich Keane via cfe-commits
@@ -1985,44 +1986,45 @@ class ClassTemplateSpecializationDecl SpecializedTemplate = TemplDecl; } - /// Sets the type of this specialization as it was written by - /// the user. This will be a class template specialization type. - void setTypeAsWritten(TypeSourceInfo *

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

2024-02-13 Thread Erich Keane via cfe-commits
@@ -222,7 +220,7 @@ int binTempl; template float binTempl = 1; -// CHECK: VarTemplatePartialSpecializationDecl 0x{{[^ ]*}} col:7 binTempl 'float' cinit erichkeane wrote: Why are we losing 'const-int' (Is that what cinit means?) here? Is that perhaps

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

2024-02-13 Thread Erich Keane via cfe-commits
@@ -279,7 +279,7 @@ namespace dr727 { // dr727: partial // cxx98-11-error@-1 {{variable templates are a C++14 extension}} // cxx98-14-error@-2 {{inline variables are a C++17 extension}} template<> static inline int v2; // #dr727-v2-T -// cxx98-14-error@-1 {{inli

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

2024-02-13 Thread Erich Keane via cfe-commits
@@ -285,30 +285,23 @@ template<> class SpecializationDecl; // CHECK: [[@LINE-1]]:7 | class(Gen,TS)/C++ | SpecializationDecl | c:@S@SpecializationDecl>#I | | Decl,RelSpecialization | rel: 1 // CHECK-NEXT: RelSpecialization | SpecializationDecl | c:@ST>1#T@SpecializationDecl -

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I like the direction of this, and look forward to seeing how this turns out! https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane approved this p

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane edited https:/

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13 +5493,

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -290,6 +290,12 @@ Bug Fix

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -9463,7 +9463,8 @@ class

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -10526,14 +1052

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

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

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-06 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > Also, this probably needs a release note. > > > > > > If you want I'll add one but this bug has been on main no longer than a > > week, so I didnt think it would be necessary. > > I see. Yeah, I don’t think we really need one if the bug was introduced and > fixed in t

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -2612,44 +2669,312 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias erichke

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm happy when Corentin is, so he can approve when he's ready. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// 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] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// 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

<    4   5   6   7   8   9   10   11   12   13   >