[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/82607 >From 22facf44ec3f97fcdc40f2431ec26ca7ef441c67 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 22 Feb 2024 13:28:04 +0300 Subject: [PATCH 1/2] [clang] Implement CWG2759 "`[[no_unique_address]` and c

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/82607 >From 22facf44ec3f97fcdc40f2431ec26ca7ef441c67 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 22 Feb 2024 13:28:04 +0300 Subject: [PATCH 1/3] [clang] Implement CWG2759 "`[[no_unique_address]` and c

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/82607 >From 22facf44ec3f97fcdc40f2431ec26ca7ef441c67 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 22 Feb 2024 13:28:04 +0300 Subject: [PATCH 1/4] [clang] Implement CWG2759 "`[[no_unique_address]` and c

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/82607 >From 22facf44ec3f97fcdc40f2431ec26ca7ef441c67 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 22 Feb 2024 13:28:04 +0300 Subject: [PATCH 1/5] [clang] Implement CWG2759 "`[[no_unique_address]` and c

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/82607 >From 22facf44ec3f97fcdc40f2431ec26ca7ef441c67 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 22 Feb 2024 13:28:04 +0300 Subject: [PATCH 1/6] [clang] Implement CWG2759 "`[[no_unique_address]` and c

[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

2024-02-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/82607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/83152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
@@ -287,6 +287,11 @@ namespace dr1837 { // dr1837: 3.3 }; }; }; + /* since-cxx11-warning@-6{{address of function '[] { Endilll wrote: Can you convert this to use a marker? We don't want readers to count relative offsets. In other words, it should

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. https://github.com/llvm/llvm-project/pull/83152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/83152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
@@ -281,7 +281,7 @@ namespace dr1837 { // dr1837: 3.3 struct A { int f(); -bool b = [] { +bool b = [] { // since-cxx11-warning{{address of lambda function pointer conversion operator will always evaluate to 'true'}} Endilll wrote: Convert this

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. DR test changes look good, save for a nit. https://github.com/llvm/llvm-project/pull/83152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/83279 ___ cfe-commits mailing list cfe-commi

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/Endilll requested changes to this pull request. https://github.com/llvm/llvm-project/pull/83279 __

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -14478,7 +14478,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/2445.html";>2445 C++20 Partia

[clang] Fix implementation of [temp.param]p14's first sentence. (PR #83487)

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: My plan is to add tests to this PR, but if you want to land this sooner, I can do tests in a separate PR. https://github.com/llvm/llvm-project/pull/83487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -14478,7 +14478,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/2445.html";>2445 C++20 Partia

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/83279 ___ cfe-commit

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

2024-03-01 Thread Vlad Serebrennikov 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 Message-ID: In-Reply-To: @@ -68,3 +68,35 @@ template struct X {}; X<1> x; #endif } +namespace dr2445 { // dr2445: 19 En

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/Endilll approved this pull request. DR changes looks good now, save for a nitpick. However, I'm leaving it to other revie

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

2024-03-01 Thread Vlad Serebrennikov via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: Endilll wrote: > I have added tests to other files what are relevant for the DR too. Should I > move them here? I trust your judgement her

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

2024-03-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/83715 This patch covers the following defect reports: [CWG438](https://cplusplus.github.io/CWG/issues/438.html) "Possible flaw in wording for multiple accesses to object between sequence points", [CWG439](https://cplu

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

2024-03-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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] Do not attempt to dump the layout of dependent types when `-fdump-record-layouts-complete` is passed (PR #83688)

2024-03-03 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: This might also fix #83671 https://github.com/llvm/llvm-project/pull/83688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] fix dereference on class/struct layouts check. (PR #83686)

2024-03-03 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I posted a different, even shorter reduction in https://github.com/llvm/llvm-project/issues/83671. https://github.com/llvm/llvm-project/pull/83686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-23 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/85605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-23 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: This looks good. Sorry for the late reply. https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #70024)

2024-03-23 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I'm not able to review Sema.h changes because of a merge conflict. https://github.com/llvm/llvm-project/pull/70024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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-23 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-24 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/84184 >From 23f4208fb9978370f59cae16db0747acb3e2c906 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Mar 2024 18:01:35 +0300 Subject: [PATCH 1/6] [clang] Factor out OpenACC part of `Sema` This patch mov

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

2024-03-24 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I added convenience functions to access `ASTContext` and other widely used facilities of `Sema` to `SemaOpenACC`. I intentionally didn't go full base class approach, saving this option for the future. https://github.com/llvm/llvm-project/pull/84184 __

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

2024-03-24 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/84184 >From 23f4208fb9978370f59cae16db0747acb3e2c906 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Mar 2024 18:01:35 +0300 Subject: [PATCH 1/7] [clang] Factor out OpenACC part of `Sema` This patch mov

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

2024-03-25 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,74 @@ +//===- 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-25 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,74 @@ +//===- 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-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-03-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/86618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-27 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Will these changes find their way into a 18.x release? Not without someone stepping up and getting them through backporting process. https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [RFC][Clang] Enable custom type checking for printf (PR #86801)

2024-03-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/86801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/84184 >From 23f4208fb9978370f59cae16db0747acb3e2c906 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Mar 2024 18:01:35 +0300 Subject: [PATCH 1/7] [clang] Factor out OpenACC part of `Sema` This patch mov

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

2024-04-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG1606 (PR #87274)

2024-04-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. LGTM! Disclosure: me and author extensively reviewed this offline before publishing. https://github.com/llvm/llvm-project/pull/87274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang] Fix crash when inheriting from a cv-qualified type (PR #70594)

2024-04-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: You might want to include a test from https://github.com/llvm/llvm-project/issues/85256#issuecomment-2031815104 https://github.com/llvm/llvm-project/pull/70594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang] Fix crash when inheriting from a cv-qualified type (PR #70594)

2024-04-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I can land this for you after CI passes. https://github.com/llvm/llvm-project/pull/70594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG1606 (PR #87274)

2024-04-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-04 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87737 This is a follow-up to #81506. Since `__is_layout_compatible()` is a C++ intrinsic (https://github.com/llvm/llvm-project/blob/ff1e72d68d1224271801ff5192a8c14fbd3be83b/clang/include/clang/Basic/TokenKinds.def#L52

[clang] [clang] Add test for CWG392 (PR #87744)

2024-04-04 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87744 [CWG392](https://cplusplus.github.io/CWG/issues/392.html) "Use of full expression lvalue before temporary destruction". We're testing that `operator bool()` is called before destructor of `C`. I'm also marking

[clang] [clang] Add test for CWG392 (PR #87744)

2024-04-04 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87744 >From 4a666d69a49386a6cd282ed112963b3d049fd3c2 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 5 Apr 2024 07:57:11 +0300 Subject: [PATCH 1/2] [clang] Add test for CWG392 [CWG392](https://cplusplus.g

[clang] [clang] Claim conformance for CWG466 (PR #87748)

2024-04-04 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87748 [CWG466](https://cplusplus.github.io/CWG/issues/466.html) "cv-qualifiers on pseudo-destructor type". Richard claimed that we don't implement this DR because of one ill-formed example being accepted: `a->CI::~VI(

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > I think the current behavior is reasonable-ish. Rejecting specific types is a > bit weird... I think VLA should model incomplete types (but we currently > don't reject that either, which is a bug) > > IE, I would expect __is_layout_compatible to return false in the presence of

[clang] [clang] Add test for CWG593 (PR #87752)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87752 [CWG593](https://cplusplus.github.io/CWG/issues/593.html) "Falling off the end of a destructor's function-try-block handler". As usual with CWG issues resolved as NAD, we test for status-quo confirmed by CWG. >

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > However, at the language level, I cannot find any wording either way. In my reading, http://eel.is/c++draft/basic.types.general#11 makes any type layout-compatible with itself, and even ignores cv-qualification: > Two types cv1 T1 and cv2 T2 are [layout-compatible > types](ht

[clang] [clang] Catch missing format attributes (PR #70024)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/70024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #70024)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. https://github.com/llvm/llvm-project/pull/70024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #70024)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
@@ -1698,6 +1698,9 @@ class Sema final { ChangedStateAtExit }; + void DiagnoseMissingFormatAttributes(const FunctionDecl *FDecl, Endilll wrote: This declaration is placed among functions implemented in `SemaAttr.cpp`, as you might see around line 1296

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(unsigned char, signed char)); static_assert(__is_layout_compatible(int[], int[])); static_assert(__is_layout_compatible(int[2], int[2])); - static_assert(!__is_layout_compatible

[clang] [clang] CTAD: build aggregate deduction guides for alias templates. (PR #85904)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good to me. https://github.com/llvm/llvm-project/pull/85904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(unsigned char, signed char)); static_assert(__is_layout_compatible(int[], int[])); static_assert(__is_layout_compatible(int[2], int[2])); - static_assert(!__is_layout_compatible

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87737 >From ef24f642ca78d357018d6023fb3d9011f115299b Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 5 Apr 2024 06:22:35 +0300 Subject: [PATCH 1/2] [clang] Reject VLAs in `__is_layout_compatible()` This i

[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/87821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: I hope #87634 will be merged soon, so you can get rid of `SemaRef.Diag()` here. https://github.com/llvm/llvm-project/pull/87821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
@@ -12252,6 +12252,8 @@ def warn_acc_clause_unimplemented def err_acc_construct_appertainment : Error<"OpenACC construct '%0' cannot be used here; it can only " "be used in a statement context">; +def err_acc_clause_appertainment +: Error<"OpenACC '%1' claus

[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
@@ -3594,11 +3595,26 @@ class Parser : public CodeCompletionHandler { OpenACCDirectiveKind DirKind; SourceLocation StartLoc; SourceLocation EndLoc; -// TODO OpenACC: Add Clause list here once we have a type for that. +SmallVector Clauses; // TODO OpenAC

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG392 (PR #87744)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Claim conformance for CWG466 (PR #87748)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Introduce `SemaBase` (PR #87634)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87634 >From 311e2ef14dda46686b473e813028a2c3b2ac1254 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 4 Apr 2024 16:07:35 +0300 Subject: [PATCH] [clang][NFC] Introduce `SemaBase` This is a follow-up to #84

[clang] [clang] Reject incomplete types in `__is_layout_compatible()` (PR #87869)

2024-04-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87869 This is a follow-up to #81506. As discussed in #87737, we're rejecting incomplete types, save for exceptions listed in the C++ standard (`void` and arrays of unknown bound). Note that arrays of unknown bound of

[clang] [clang] Add CodeGen tests for CWG 6xx issues (PR #87876)

2024-04-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87876 This patch covers [CWG605](https://cplusplus.github.io/CWG/issues/605.html) "Linkage of explicit specializations", [CWG650](https://cplusplus.github.io/CWG/issues/650.html) "Order of destruction for temporaries

[clang] [clang][NFC] Introduce `SemaBase` (PR #87634)

2024-04-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend lifetime of temporaries in mem-default-init for P2718R0 (PR #86960)

2024-04-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/86960 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87909 This patch covers [CWG393](https://cplusplus.github.io/CWG/issues/393.html) "Pointer to array of unknown bound in template argument list in parameter" [CWG528](https://cplusplus.github.io/CWG/issues/528.html) "Wh

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/87909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/87912 This patch introduces `SemaHLSL` class, and moves some HLSL-related functions there. No functional changes intended. This is a part of the effort to split `Sema` into smaller manageable parts, and follows the e

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: clang-format 18.1.1 that we use in the workflow is complaining, because it's missing #82097. https://github.com/llvm/llvm-project/pull/87912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang][NFC] Remove "Sema" prefix from Sema-related functions (PR #87914)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87912 >From 4a60eb0da7d74ca002040aede6ffc9220314ca33 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 7 Apr 2024 12:35:07 +0300 Subject: [PATCH] [clang] Introduce `SemaHLSL` --- clang/include/clang/Sema/S

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/87912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87912 >From 4a60eb0da7d74ca002040aede6ffc9220314ca33 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 7 Apr 2024 12:35:07 +0300 Subject: [PATCH 1/2] [clang] Introduce `SemaHLSL` --- clang/include/clang/Se

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1967,6 +1973,11 @@ class Sema final : public SemaBase { bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto); + bool BuiltinVectorMath(CallExpr *TheCall, QualType &Res); + bool BuiltinVectorToScalarMath

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Should these be moved? Given their names, they are clearly on the list. However, I'm keeping the scope of this patch limited. I'd like to focus on getting HLSL contributors on board first. https://github.com/llvm/llvm-project/pull/87912 ___

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/87909 >From 222f444f91d477bbc1ab2657a7f820740031f765 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 7 Apr 2024 10:52:10 +0300 Subject: [PATCH 1/2] [clang] Add tests for some CWG 5xx issues --- clang/tes

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
@@ -265,6 +269,18 @@ namespace dr527 { // dr527: na int ax = a.x, bx = b.x, cx = c.x, dx = d.x, ex = E::e->x, fx = F::f->x; } +namespace dr528 { // dr528: 2.7 Endilll wrote: For NAD issues, we write tests that check for status quo, and report the first ver

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
@@ -661,6 +680,10 @@ namespace dr553 { } // dr554: na + +// dr555: na Endilll wrote: I'm not keen to copy tests for an issue that is officially recognized as duplicate. https://github.com/llvm/llvm-project/pull/87909

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
@@ -1568,6 +1568,18 @@ namespace dr391 { // dr391: 2.8 c++11 } // dr392 is in dr392.cpp + +namespace dr393 { // dr393: 2.7 + +template +struct S {}; + +void f1(S); +void f2(S); +void g(int(*S::*)[]); Endilll wrote: Done. https://github.com/llvm/llvm-project

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,37 @@ +//===- SemaHLSL.h - Semantic Analysis for HLSL 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] Introduce `SemaHLSL` (PR #87912)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add CodeGen tests for CWG 6xx issues (PR #87876)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87876 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add test for CWG593 (PR #87752)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reject incomplete types in `__is_layout_compatible()` (PR #87869)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/87869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88086 This patch moves SYCL-related `Sema` functions into new `SemaSYCL` class, following the recent example of OpenACC and HLSL. This is a part of the effort to split `Sema`. Additional context can be found in #82217

[clang] c7db450 - [clang][NFC] Refactor `EvaluateBinaryTypeTrait` to accept `TypeSourceInfo`

2024-04-08 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-04-09T08:51:36+03:00 New Revision: c7db450e5c1a83ea768765dcdedfd50f3358d418 URL: https://github.com/llvm/llvm-project/commit/c7db450e5c1a83ea768765dcdedfd50f3358d418 DIFF: https://github.com/llvm/llvm-project/commit/c7db450e5c1a83ea768765dcdedfd50f3358d418.

[clang] [clang] Improve source location in binary type traits diagnostics (PR #88097)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88097 This patch takes advantage of a recent NFC change that refactored `EvaluateBinaryTypeTrait()` to accept `TypeSourceInfo` instead of `QualType` c7db450e5c1a83ea768765dcdedfd50f3358d418. Before: ``` test2.cpp:105:

[clang] [clang] Improve source location in binary type traits diagnostics (PR #88097)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88097 >From 3bc2d71cbe5e5613b430968fe84023a736072e54 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 9 Apr 2024 10:20:10 +0300 Subject: [PATCH 1/2] [clang] Improve source location in binary type traits di

[clang] [clang] Improve source location in binary type traits diagnostics (PR #88097)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Do we now have enough information to pass a source range as well? Yes, `TypeLoc` inside `TypeSourceInfo` has two `SourceLocation` object that represent the range. In order to limit the scope of the PR, I'm not refactoring `RequireCompleteType` and friends to accept `TypeSource

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
@@ -661,6 +680,10 @@ namespace dr553 { } // dr554: na + +// dr555: na Endilll wrote: Ah, I confused this with CWG550, which is a duplicate. I still would like to avoid copying tests, though. https://github.com/llvm/llvm-project/pull/87909 ___

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/88042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. https://github.com/llvm/llvm-project/pull/88042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
@@ -58,3 +58,24 @@ void B::g() requires true; #endif } // namespace dr2847 + +namespace dr2858 { // dr2858: 19 + +#if __cplusplus > 202302L + +template +struct A { + // FIXME: The nested-name-specifier in the following friend declarations are declarative, + // but we don't

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