[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

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

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/15] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
@@ -90,6 +90,12 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Implemented `__is_layout_compatible` intrinsic, which backs up + `P0466R5: Layout-compatibility and

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/14] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/13] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread A. Jiang via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/12] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-18 Thread via cfe-commits
@@ -90,6 +90,12 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Implemented `__is_layout_compatible` intrinsic, which backs up + `P0466R5: Layout-compatibility and

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-18 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/11] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 01/10] Initial implementation --- clang/include/clang/Basic

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 1/9] Initial implementation --- clang/include/clang/Basic/T

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-16 Thread Aaron Ballman via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

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

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 1/8] Initial implementation --- clang/include/clang/Basic/T

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

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

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-16 Thread Vlad Serebrennikov via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-15 Thread Aaron Ballman via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-15 Thread via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-14 Thread Aaron Ballman via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! Please be sure to also add a release note and documentation (https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives). https://github.com/llvm/llvm-project/pull/81506 ___

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread Vlad Serebrennikov via cfe-commits
@@ -1717,6 +1717,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, tok::kw___is_fundamental, tok::kw___is_integral, tok::kw___is_interface_class, + tok::kw___is_layout_compatible, Endilll wrote: Done http

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 1/6] Initial implementation --- clang/include/clang/Basic/T

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread Vlad Serebrennikov via cfe-commits
@@ -14040,6 +14040,8 @@ class Sema final { bool SemaValueIsRunOfOnes(CallExpr *TheCall, unsigned ArgNum); public: + bool SemaIsLayoutCompatible(QualType T1, QualType T2); Endilll wrote: Done https://github.com/llvm/llvm-project/pull/81506

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 1/5] Initial implementation --- clang/include/clang/Basic/T

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread via cfe-commits
@@ -14040,6 +14040,8 @@ class Sema final { bool SemaValueIsRunOfOnes(CallExpr *TheCall, unsigned ArgNum); public: + bool SemaIsLayoutCompatible(QualType T1, QualType T2); cor3ntin wrote: Agreed, this should be renamed IsLayoutCompatible (and be const) htt

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread via cfe-commits
https://github.com/cor3ntin commented: This looks good generally. Can you add a changelog entry? Can you add some doc in LanguageExtension.rst? Thanks https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread via cfe-commits
@@ -1717,6 +1717,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, tok::kw___is_fundamental, tok::kw___is_integral, tok::kw___is_interface_class, + tok::kw___is_layout_compatible, cor3ntin wrote: I don't t

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-13 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread Timm Baeder via cfe-commits
@@ -14040,6 +14040,8 @@ class Sema final { bool SemaValueIsRunOfOnes(CallExpr *TheCall, unsigned ArgNum); public: + bool SemaIsLayoutCompatible(QualType T1, QualType T2); tbaederr wrote: Can this function no be `const`? And I guess the "Sema" prefix is to

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Formatting suggestions to `ParseDeclCXX.cpp` are too disruptive. I'm not going to commit them. https://github.com/llvm/llvm-project/pull/81506 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/81506 >From 52b239153b2fc4f52e889ad2044daa6ed5cbc836 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 12 Feb 2024 17:44:38 +0300 Subject: [PATCH 1/3] Initial implementation --- clang/include/clang/Basic/T

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff b45de48be24695b613f48ed21bb35f844454193b 5599465e3c3921571fd22d18a5854ced3a752d80 --

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch implements `__is_layout_compatible`, which backs up `std::is_layout_compatible` type trait introduced in C++20 ([P0466R5](https://wg21.link/p0466r5) "Layout-compatibility and Pointer-interc

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/81506 This patch implements `__is_layout_compatible`, which backs up `std::is_layout_compatible` type trait introduced in C++20 ([P0466R5](https://wg21.link/p0466r5) "Layout-compatibility and Pointer-interconvertibil