[clang] [clang] Migrate DR tests to `static_assert` (PR #88611)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
@@ -5,6 +5,17 @@ // RUN: %clang_cc1 -std=c++11 -verify=expected,cxx98-14,cxx98-17,cxx98-20,cxx11-14,since-cxx11 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++98 -verify=expected,cxx98-14,cxx98-17,cxx98-20,cxx98

[clang] 0412a86 - [clang] Add missing documentation entry for `__is_pointer_interconvertible_base_of()`

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-04-13T13:10:42+03:00 New Revision: 0412a8651aa6cbdd697e904a758e0f95e6635cee URL: https://github.com/llvm/llvm-project/commit/0412a8651aa6cbdd697e904a758e0f95e6635cee DIFF:

[clang] [clang] Migrate DR tests to `static_assert` (PR #88611)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: This PR removes a FIXME since it doesn't make sense anymore in that particular context. I created issue #88608 out of it to make sure we don't lose track of it. https://github.com/llvm/llvm-project/pull/88611 ___ cfe-commits mailing

[clang] [clang] Migrate DR tests to `static_assert` (PR #88611)

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

[clang] [clang] Migrate DR tests to `static_assert` (PR #88611)

2024-04-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88611 This patch touches a number of tests that run in C++98 mode that have been using array size as a context that requires a constant expression, replacing it with a `static_assert` backported via a macro. This

[clang] 5b36bf5 - [clang][NFC] Tidy up extension warnings about `_Static_assert`

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-04-13T08:40:26+03:00 New Revision: 5b36bf549c8c900d0f01451e02abd821f38d4538 URL: https://github.com/llvm/llvm-project/commit/5b36bf549c8c900d0f01451e02abd821f38d4538 DIFF:

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

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

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

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

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88473 >From 84907542cecbe76b1971a50642d39ec4d1078687 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Apr 2024 08:18:06 +0300 Subject: [PATCH 1/5] [clang] Implement

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Have you run the CUDA / HIP tests in the external test suite or anything? No, just `check-clang` target. You think it's necessary to run something else before merging? If so, you should point me out to what to run, and preferably give some instructions, as CUDA development is

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,304 @@ +//===- SemaCUDA.h - Semantic Analysis for CUDA 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:

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -19710,6 +19710,27 @@ bool Sema::IsLayoutCompatible(QualType T1, QualType T2) const { return isLayoutCompatible(getASTContext(), T1, T2); } +//===-- Pointer interconvertibility // + +bool

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -19710,6 +19710,27 @@ bool Sema::IsLayoutCompatible(QualType T1, QualType T2) const { return isLayoutCompatible(getASTContext(), T1, T2); } +//===-- Pointer interconvertibility // + +bool

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -6082,6 +6082,22 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI Self.Diag(Rhs->getTypeLoc().getBeginLoc(), diag::err_vla_unsupported) << 1 << tok::kw___is_layout_compatible; return Self.IsLayoutCompatible(LhsT, RhsT); +

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88473 >From 84907542cecbe76b1971a50642d39ec4d1078687 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Apr 2024 08:18:06 +0300 Subject: [PATCH 1/4] [clang] Implement

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1740,7 +1740,7 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(void, int)); static_assert(__is_layout_compatible(void, const void)); static_assert(__is_layout_compatible(void, volatile void)); - static_assert(__is_layout_compatible(const

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

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed 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] c39df49 - [clang][NFC] Refactor `CUDAFunctionTarget`

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-04-12T13:06:59+03:00 New Revision: c39df496d73621238ba87de235d9a61e2b2203b9 URL: https://github.com/llvm/llvm-project/commit/c39df496d73621238ba87de235d9a61e2b2203b9 DIFF:

[clang] d019b9a - [clang][NFC] Refactor `CXXSpecialMember`

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-04-12T12:21:14+03:00 New Revision: d019b9a60c858ee82fdbaf5de16e048e9db2 URL: https://github.com/llvm/llvm-project/commit/d019b9a60c858ee82fdbaf5de16e048e9db2 DIFF:

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -6082,6 +6082,22 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI Self.Diag(Rhs->getTypeLoc().getBeginLoc(), diag::err_vla_unsupported) << 1 << tok::kw___is_layout_compatible; return Self.IsLayoutCompatible(LhsT, RhsT); +

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88473 >From 84907542cecbe76b1971a50642d39ec4d1078687 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Apr 2024 08:18:06 +0300 Subject: [PATCH 1/3] [clang] Implement

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88473 >From 84907542cecbe76b1971a50642d39ec4d1078687 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Apr 2024 08:18:06 +0300 Subject: [PATCH 1/2] [clang] Implement

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1839,6 +1839,90 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(EnumClassForward, int)); } +namespace IPIBO { +struct Base {}; +struct Base2 {}; +struct Base3 : Base {}; +struct Base3Virtual : virtual Base {}; +struct Derived : Base {}; +struct

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1839,6 +1839,90 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(EnumClassForward, int)); } +namespace IPIBO { +struct Base {}; +struct Base2 {}; +struct Base3 : Base {}; +struct Base3Virtual : virtual Base {}; +struct Derived : Base {}; +struct

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1740,7 +1740,7 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(void, int)); static_assert(__is_layout_compatible(void, const void)); static_assert(__is_layout_compatible(void, volatile void)); - static_assert(__is_layout_compatible(const

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -6082,6 +6082,22 @@ static bool EvaluateBinaryTypeTrait(Sema , TypeTrait BTT, const TypeSourceI Self.Diag(Rhs->getTypeLoc().getBeginLoc(), diag::err_vla_unsupported) << 1 << tok::kw___is_layout_compatible; return Self.IsLayoutCompatible(LhsT, RhsT); +

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-12 Thread Vlad Serebrennikov via cfe-commits
@@ -19710,6 +19710,27 @@ bool Sema::IsLayoutCompatible(QualType T1, QualType T2) const { return isLayoutCompatible(getASTContext(), T1, T2); } +//===-- Pointer interconvertibility // + +bool

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

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

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-11 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Relevant issue: #48204 https://github.com/llvm/llvm-project/pull/88473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_pointer_interconvertible_base_of()` (PR #88473)

2024-04-11 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88473 This patch implements intrinsic that supports `std::is_pointer_interconvertible_base_of` type trait from [P0466R5](https://wg21.link/p0466r5) "Layout-compatibility and Pointer-interconvertibility Traits".

[clang] [clang][NFC] Move more functions to `SemaHLSL` (PR #88354)

2024-04-11 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/88354 ___ 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-11 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Please do. This is going to be reverted by the next person fetching from public index page anyway, because we ask people to run the script every time they have changes for `cxx_dr_status.html`. In any case, WG21 wikis are of restricted access, and we shouldn't make their

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

2024-04-11 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: `make_cxx_dr_status` is not going to do anything here, since the DR indeed didn't make it into public list. Merge as-is. 2858 is going to be picked up when someone runs the script for the first time after a new revision of core issues list is published.

[clang] [clang][NFC] Move more functions to `SemaHLSL` (PR #88354)

2024-04-10 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/88354 A follow-up to #87912. I'm moving more HLSL-related functions from `Sema` to `SemaHLSL`. I'm also dropping `HLSL` from their names in the process. >From ecff8db824552872ba055fdc0bca42b1a0386c39 Mon Sep 17

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

2024-04-10 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/88086 ___ 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-09 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL constructs ---===// Endilll wrote: That's... embarrassing. https://github.com/llvm/llvm-project/pull/88086 ___ cfe-commits mailing list

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

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL 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:

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

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL 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:

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

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/88086 >From 9a5c872a8cb7de103841538d251df2f4638a4f5e Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 9 Apr 2024 06:38:25 +0300 Subject: [PATCH 1/2] [clang] Introduce `SemaSYCL` ---

[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 closed https://github.com/llvm/llvm-project/pull/88097 ___ 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-09 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] 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: I added a proper test for 555. Basically, I copied 466 test, and derived reference tests from it. In 466, I derived a test for non-pointer and non-reference scalar types.

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

2024-04-09 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/3] [clang] Add tests for some CWG 5xx issues ---

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

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: This looks much better now, thank you! As Corentin suggested earlier, run `clang/www/make_cxx_dr_status` to update the DR page, and this should be good to go. https://github.com/llvm/llvm-project/pull/88042 ___

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/88139 ___ 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

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

[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

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

[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

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

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

[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

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

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

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

[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] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-08 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] Introduce `SemaHLSL` (PR #87912)

2024-04-08 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 ); + bool

[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] [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] [clang] Introduce `SemaHLSL` ---

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

[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

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

[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][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] 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] Reject incomplete types in `__is_layout_compatible()` (PR #87869)

2024-04-06 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][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

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

[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

[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

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

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

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

[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

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

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

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

2024-04-05 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:

[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

[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

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