[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

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

[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

2024-05-07 Thread Erich Keane via cfe-commits
@@ -0,0 +1,58 @@ +// RUN: %clang_cc1 -std=c++20 -verify %s + +template +concept C = I >= 4; + +template +concept D = I < 8; + +template +struct A { + constexpr static int f() { return 0; } + constexpr static int f() requires C && D { return 1; } + constexpr static int f()

[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

2024-05-07 Thread Erich Keane via cfe-commits
@@ -5437,6 +5437,11 @@ def note_function_template_spec_matched : Note< def err_function_template_partial_spec : Error< "function template partial specialization is not allowed">; +def err_function_member_spec_ambiguous : Error< +"ambiguous member function

[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

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

[clang] [Clang][Sema] Improve support for explicit specializations of constrained member functions & member function templates (PR #88963)

2024-05-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Do we need a release note? Else LGTM. https://github.com/llvm/llvm-project/pull/88963 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Don't set instantiated from function when rewriting operator<=> (PR #91339)

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

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Seems simple enough, and the AST output looks reasonable. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This looks good to me, please give this a day or so for any conversations to die down. https://github.com/llvm/llvm-project/pull/91140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement __reference_converts_from_temporary (PR #91199)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -1779,9 +1779,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, tok::kw___is_union, tok::kw___is_unsigned, tok::kw___is_void, - tok::kw___is_volatile, - tok::kw___reference_binds_to_temporary, -

[clang] [Clang][Sema] Explicit template arguments are not substituted into the exception specification of a function (PR #90760)

2024-05-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM. I want @Endilll to confirm the DR test looks right though. https://github.com/llvm/llvm-project/pull/90760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Don't wrap immediate invocations in ConstantExprs within constexpr initializers (PR #89565)

2024-05-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This seems reasonable to me, I think @cor3ntin should also approve before committing though. https://github.com/llvm/llvm-project/pull/89565 ___ cfe-commits mailing list

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -134,6 +134,8 @@ def err_fe_no_pch_in_dir : Error< "no suitable precompiled header file found in directory '%0'">; def err_fe_action_not_available : Error< "action %0 not compiled in">; +def err_fe_invalid_multiple_actions : Error< +"action %0 is specified,

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

2024-05-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: CI seems to have noticed what I feared :) This is going to hit a good amount of our internal tests, there is no way our copy-paste cargo-cult didn't come up with this before. https://github.com/llvm/llvm-project/pull/91140

[clang] cc1: Report an error for multiple actions unless separated by -main-file-name (PR #91140)

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

[clang] [Clang] Implement __reference_converts_from_temporary (PR #91199)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -1779,9 +1779,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, tok::kw___is_union, tok::kw___is_unsigned, tok::kw___is_void, - tok::kw___is_volatile, - tok::kw___reference_binds_to_temporary, -

[clang] [Clang] Implement __reference_converts_from_temporary (PR #91199)

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

[clang] [Clang] Implement __reference_converts_from_temporary (PR #91199)

2024-05-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Seems reasonable to me. Curious about 1 change though. https://github.com/llvm/llvm-project/pull/91199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s erichkeane wrote: > We don't have any IR to test just yet. @lanza you could use `FileCheck` with > `--allow-empty` here for now. You could also rename this test

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -42,6 +47,14 @@ CreateFrontendBaseAction(CompilerInstance ) { StringRef Action("unknown"); (void)Action; + auto UseCIR = CI.getFrontendOpts().UseClangIRPipeline; erichkeane wrote: Thats a question I think for @AaronBallman . This DOES live in the

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,61 @@ +//=== CIRGenAction.h - CIR Code Generation Frontend Action -*- 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:

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s erichkeane wrote: Would still like this to 'pipe' to filecheck. In addition to 'not crash', it would be worthwhile to ensure we emit sensible IR.

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -42,6 +47,14 @@ CreateFrontendBaseAction(CompilerInstance ) { StringRef Action("unknown"); (void)Action; + auto UseCIR = CI.getFrontendOpts().UseClangIRPipeline; erichkeane wrote: Coding standard doesn't allow use of 'auto' here, only when the actual

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,61 @@ +//===--- CIRGenModule.h - Per-Module state for CIR gen --*- 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:

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,59 @@ +//===- CIRGenerator.h - CIR Generation from Clang AST -===// +// +// 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] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -53,8 +66,13 @@ CreateFrontendBaseAction(CompilerInstance ) { case DumpTokens: return std::make_unique(); case EmitAssembly: return std::make_unique(); case EmitBC: return std::make_unique(); +#if CLANG_ENABLE_CIR + case EmitCIR:

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,61 @@ +//===--- CIRGenModule.h - Per-Module state for CIR gen --*- 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:

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -0,0 +1,61 @@ +//=== CIRGenAction.h - CIR Code Generation Frontend Action -*- 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:

[clang] [Clang][Sema] Fix template name lookup for operator= (PR #90999)

2024-05-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. No need for release notes,as you said, this is a fix within this release. https://github.com/llvm/llvm-project/pull/90999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-03 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I think this is actually a bug in how I applied [[temp.dep.type] > p5](http://eel.is/c++draft/temp.dep.type#5): > > > A qualified name is dependent if > > > > * it is a _conversion-function-id_ whose _conversion-type-id_ is dependent, > > or > > * its lookup

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: >Does this test

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-03 Thread Erich Keane via cfe-commits
erichkeane wrote: > This seems to break the version of libstdc++ we use in our sysroot: (Details > on https://crbug.com/338536261) > > ``` > ../../build/linux/debian_bullseye_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator.h:1718:20: > error: use

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: > In this snippet

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: Ah, I see that

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

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

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Erich Keane via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD erichkeane wrote: I meant something

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm still OK with this, but @shafik : Please ensure this has the test coverage you asked for. https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This is introducing a new type that has a pretty subtle difference vs others. Can we have some documentation in the internals manual explaining the difference? Code wise, I think this looks fine. https://github.com/llvm/llvm-project/pull/89019

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think I'm ok with this, please give others a day or two to sign off as well. https://github.com/llvm/llvm-project/pull/90894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: > @yxsamliu The type of `this` is always a pointer. The class member access > operator may only be overloaded for operands of class type. In your reduced > example, could you provide a value of `T` that would instantiate to a valid > specialization? Agreed, this is another

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: >This is the option I've decided to go with here. There's a slight wrinkle in >that we create a LookupResult that claims we looked up the unnamed field for >the anonymous class -- even though we would obviously never be able to look up >an unnamed field. I think this is

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: Also, test failures are related to this patch! https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
@@ -3858,7 +3858,8 @@ static Expr *BuildFloatingLiteral(Sema , NumericLiteralParser , using llvm::APFloat; APFloat Val(Format); - APFloat::opStatus result = Literal.GetFloatValue(Val); + APFloat::opStatus result = erichkeane wrote: Does this work

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: probably needs a release note https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

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

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: Also needs release note. https://github.com/llvm/llvm-project/pull/90894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-02 Thread Erich Keane via cfe-commits
@@ -2803,7 +2803,207 @@ getRHSTemplateDeclAndArgs(Sema , TypeAliasTemplateDecl *AliasTemplate) { return {Template, AliasRhsTemplateArgs}; } -// Build deduction guides for a type alias template. +// Build deduction guides for a type alias template from the given underlying

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-02 Thread Erich Keane via cfe-commits
@@ -261,6 +261,13 @@ AG ag = {1}; // CHECK: | `-BuiltinType {{.*}} 'int' // CHECK: `-ParmVarDecl {{.*}} 'int' +template +using BG = G; +BG bg = {1.0}; +// CHECK-LABEL: Dumping +// CHECK: FunctionTemplateDecl erichkeane wrote: Could these be

[clang] [OpenACC] Implement SubArray Parsing/Sema (PR #90796)

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

[clang] [OpenACC] Implement SubArray Parsing/Sema (PR #90796)

2024-05-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/90796 >From ac69522bf15c7c169c4cdb9d3d1547c5c0962193 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 30 Apr 2024 11:42:35 -0700 Subject: [PATCH 1/2] [OpenACC} Implement SubArray Parsing/Sema This

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: I think the `-fdelayed-template-parsing` is as much as we're going to do. This is a conformance issue, and I don't think we want to create a backwards compatibility flag for it. Clang has ALWAYS diagnosed un-instantiatable templates as aggressively as we could. ALL of the

[clang] [OpenACC} Implement SubArray Parsing/Sema (PR #90796)

2024-05-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/90796 This implementation takes quite a bit from the OMP implementation of array sections, but only has to enforce the rules as applicable to OpenACC. Additionally, it does its best to create an AST node (with

[clang] [clang][Sema] Re-use existing BinaryOperator if possible (PR #90625)

2024-05-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems reasonable to me. We need a release note however. https://github.com/llvm/llvm-project/pull/90625 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] fix a bug on constraint check with template friend function (PR #90646)

2024-05-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems reasonable, @mizvekov is doing more work in this area, so I'd like him to make sure this isn't something he's fixed elsewhere. https://github.com/llvm/llvm-project/pull/90646 ___ cfe-commits mailing

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

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

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -166,3 +176,9 @@ void OpenACCClausePrinter::VisitVectorLengthClause( const OpenACCVectorLengthClause ) { OS << "vector_length(" << C.getIntExpr() << ")"; } + +void OpenACCClausePrinter::VisitPrivateClause(const OpenACCPrivateClause ) { + OS << "private("; +

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/90521 >From 54ba7d0b7d71d751cf268c3bdfb89bc5ca628a6b Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 22 Apr 2024 13:31:52 -0700 Subject: [PATCH 1/4] [OpenACC] Private Clause on Compute Constructs The private

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -166,3 +176,9 @@ void OpenACCClausePrinter::VisitVectorLengthClause( const OpenACCVectorLengthClause ) { OS << "vector_length(" << C.getIntExpr() << ")"; } + +void OpenACCClausePrinter::VisitPrivateClause(const OpenACCPrivateClause ) { + OS << "private("; +

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -423,6 +450,52 @@ ExprResult SemaOpenACC::ActOnIntExpr(OpenACCDirectiveKind DK, return IntExpr; } +ExprResult SemaOpenACC::ActOnVar(Expr *VarExpr) { + // We still need to retain the array subscript/subarray exprs, so work on a + // copy. + Expr *CurVarExpr =

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -134,6 +134,24 @@ OpenACCNumGangsClause *OpenACCNumGangsClause::Create(const ASTContext , return new (Mem) OpenACCNumGangsClause(BeginLoc, LParenLoc, IntExprs, EndLoc); } +OpenACCPrivateClause *OpenACCPrivateClause::Create(const ASTContext , +

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/90521 >From 54ba7d0b7d71d751cf268c3bdfb89bc5ca628a6b Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 22 Apr 2024 13:31:52 -0700 Subject: [PATCH 1/3] [OpenACC] Private Clause on Compute Constructs The private

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

2024-04-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'd like someone to review the AST matcher changes (the code owner listed in > `CodeOwners.rst` appears to be inactive). Ah, yes! Unfortunately I think he's the best person to review, I don't know of anyone familiar enough with the matchers. But he'll be back next week.

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

2024-04-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > Ping @AaronBallman Aaron is on vacation this week, is there feedback from him that you're looking for? https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -958,13 +931,14 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams( case OpenACCClauseKind::Link: case OpenACCClauseKind::NoCreate: case OpenACCClauseKind::Present: -case OpenACCClauseKind::Private: case OpenACCClauseKind::UseDevice:

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -423,6 +450,52 @@ ExprResult SemaOpenACC::ActOnIntExpr(OpenACCDirectiveKind DK, return IntExpr; } +ExprResult SemaOpenACC::ActOnVar(Expr *VarExpr) { + // We still need to retain the array subscript/subarray exprs, so work on a + // copy. + Expr *CurVarExpr =

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This LGTM, but please give @efriedma-quic a day or two to confirm this looks right for him too. https://github.com/llvm/llvm-project/pull/90066 ___ cfe-commits mailing list

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

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

[clang] [Clang][Sema][Parse] Delay parsing of noexcept-specifiers in friend function declarations (PR #90517)

2024-04-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Corentin's request for a comment makes sense to me, or perhaps a better name th an just 'D'? So please take care of his request, but otherwise LGTM. https://github.com/llvm/llvm-project/pull/90517

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -11196,6 +11198,31 @@ void OpenACCClauseTransform::VisitNumGangsClause( ParsedClause.getLParenLoc(), ParsedClause.getIntExprs(), ParsedClause.getEndLoc()); } + +template +void OpenACCClauseTransform::VisitPrivateClause( +const OpenACCPrivateClause ) { +

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -423,6 +450,52 @@ ExprResult SemaOpenACC::ActOnIntExpr(OpenACCDirectiveKind DK, return IntExpr; } +ExprResult SemaOpenACC::ActOnVar(Expr *VarExpr) { + // We still need to retain the array subscript/subarray exprs, so work on a + // copy. + Expr *CurVarExpr =

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
@@ -958,13 +931,14 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams( case OpenACCClauseKind::Link: case OpenACCClauseKind::NoCreate: case OpenACCClauseKind::Present: -case OpenACCClauseKind::Private: case OpenACCClauseKind::UseDevice:

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/90521 >From 54ba7d0b7d71d751cf268c3bdfb89bc5ca628a6b Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 22 Apr 2024 13:31:52 -0700 Subject: [PATCH 1/2] [OpenACC] Private Clause on Compute Constructs The private

[clang] [Clang][Parse] Delay parsing of noexcept-specifiers in friend function declarations (PR #90517)

2024-04-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Missing test + release note. In the future, please use 'draft pull request' when your patch is not ready for review/to be committed. https://github.com/llvm/llvm-project/pull/90517 ___ cfe-commits mailing

[clang] [OpenACC] Private Clause on Compute Constructs (PR #90521)

2024-04-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/90521 The private clause is the first that takes a 'var-list', thus this has a lot of additional work to enable the var-list type. A 'var' is a traditional variable reference, subscript, member-expression, or

[clang] [Attributes] Support Attributes being declared as supporting an experimental late parsing mode "extension" (PR #88596)

2024-04-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This looks fine enough to me. Aaron is away this week, so you can either let him review this when he gets back, or just merge this and let him make comments on followups/on the commit when he gets back.

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-04-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This needs a release note, likely in the 'potentially breaking changes'. Projects are filled with code that is not ever instantiated, and Clang's aggressive instantiation can be a problem. Else, LGTM.

[clang] [Clang] Address post commit feedbacks in #89906 (PR #90495)

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

[clang] Don't wrap immediate invocations in ConstantExprs within constexpr initializers (PR #89565)

2024-04-29 Thread Erich Keane via cfe-commits
@@ -16548,11 +16548,10 @@ static void CheckImplicitConversion(Sema , Expr *E, QualType T, std::string PrettySourceValue = toString(Value, 10); std::string PrettyTargetValue = PrettyPrintInRange(Value, TargetRange); -S.DiagRuntimeBehavior( -

[clang] [AST] Dump explicit template arguments for UnreslovedLookupExpr. (PR #90466)

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

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

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

[clang] [AST] Dump explicit template arguments for UnreslovedLookupExpr. (PR #90466)

2024-04-29 Thread Erich Keane via cfe-commits
@@ -107,3 +107,17 @@ auto FooFunc(C auto V) -> C decltype(auto) { } } + +namespace dump_unreslove_lookup_arguments { erichkeane wrote: This is the wrong file for this, it is meant for `concepts`, which this isn't really related to.

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

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

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-04-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Code changes LGTM, please add the tests, and I'll do another run at this. https://github.com/llvm/llvm-project/pull/90152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-04-26 Thread Erich Keane via cfe-commits
erichkeane wrote: Please also identify the changes you made vs the previous patch. https://github.com/llvm/llvm-project/pull/90152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -1753,17 +1740,18 @@ Possible Questions How modules speed up compilation -A classic theory for the reason why modules speed up the compilation is: -if there are ``n`` headers and ``m`` source files and each header is included by each

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -8,79 +8,60 @@ Standard C++ Modules Introduction -The term ``modules`` has a lot of meanings. For the users of Clang, modules may -refer to ``Objective-C Modules``, ``Clang C++ Modules`` (or ``Clang Header Modules``, -etc.) or ``Standard C++ Modules``. The

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -998,25 +992,23 @@ headers to: ... #endif -If the modules imported by your library provides such headers too, remember to add them to -your ``your_library_imported.h`` too. +If the modules imported by the library provide such headers, remember to add +them to

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -1222,33 +1214,31 @@ One often reported example is: export module repro; export import :part; -Currently the compiler complains about the inconsistent definition of `fun()` in -2 module units. This is incorrect. Since both definitions of `fun()` has the same

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -738,22 +736,21 @@ the following style significantly: import M; ... // use declarations from module M. -The key part of the tip is to reduce the duplications from the text includes. +Reducing the duplication from textual includes is what improves compile-time

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -925,45 +923,41 @@ In that case, you need to convert your source files (.cpp files) to module imple // Following off should be unchanged. ... -The module implementation unit will import the primary module implicitly. -We don't include any headers in the module

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -738,22 +736,21 @@ the following style significantly: import M; ... // use declarations from module M. -The key part of the tip is to reduce the duplications from the text includes. +Reducing the duplication from textual includes is what improves compile-time

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -577,15 +574,16 @@ the generated BMI specified by ``-o`` will be full BMI and the BMI specified by -> ... -> consumer_n.cpp -We don't emit diagnostics if

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -875,11 +872,11 @@ The pattern for ABI breaking style is similar with export extern-C++ style. } #endif -(And add `EXPORT` and conditional include to the headers as suggested in the export -extern-C++ style section) +(And add `EXPORT` and conditional include to the

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -216,51 +198,56 @@ We explain the options in the following sections. How to enable standard C++ modules ~~ -Currently, standard C++ modules are enabled automatically -if the language standard is ``-std=c++20`` or newer. +Standard C++ modules

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -289,20 +277,20 @@ we can't compile them by the original command lines. But we are still able to do $ ./Hello.out Hello World! -Module name requirement -~~~ +Module name requirements + -[module.unit]p1 says: +.. -..

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -312,75 +300,76 @@ So all of the following name is not valid by default: __test // and so on ... -If you still want to use the reserved module names for any reason, use -``-Wno-reserved-module-identifier`` to suppress the warning. +Using a reserved module name is

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -312,75 +300,76 @@ So all of the following name is not valid by default: __test // and so on ... -If you still want to use the reserved module names for any reason, use -``-Wno-reserved-module-identifier`` to suppress the warning. +Using a reserved module name is

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -138,7 +120,7 @@ Let's see a "hello world" example that uses modules. return 0; } -Then we type: +From the command line, enter: erichkeane wrote: Then, on the command line, invoke clang like: https://github.com/llvm/llvm-project/pull/90237

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -312,75 +300,76 @@ So all of the following name is not valid by default: __test // and so on ... -If you still want to use the reserved module names for any reason, use -``-Wno-reserved-module-identifier`` to suppress the warning. +Using a reserved module name is

[clang] Revise the modules document for clarity (PR #90237)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -530,43 +527,43 @@ Now the linkage name of ``NS::foo()`` will be ``_ZN2NS3fooEv``. Module Initializers ~~~ -All the importable module units are required to emit an initializer function. -The initializer function should contain calls to importing modules

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