https://github.com/erichkeane edited
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
philnik777 wrote:
> This seems reasonable to me? I'm not a huge fan of how much is being put into
> `SemaTemplate.cpp` to support all the builtins though. I'm wondering if we
> need to split that up in a follow-up and have a `SemaTemplateBuiltins` for
> all of these to live.
I can take a look
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -50,3 +50,29 @@ def __builtin_common_type : BuiltinTemplate<
Template<[Class<"TypeMember">], "HasTypeMember">,
Class<"HasNoTypeMember">,
Class<"Ts", /*is_variadic=*/1>]>;
+
+// template class,"
+// template class> class BasicCommonReferenceT,"
https://github.com/erichkeane approved this pull request.
This seems reasonable to me? I'm not a huge fan of how much is being put into
`SemaTemplate.cpp` to support all the builtins though. I'm wondering if we
need to split that up in a follow-up and have a `SemaTemplateBuiltins` for all
of
@@ -17,16 +17,37 @@
#include <__type_traits/is_reference.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/remove_reference.h>
+#include <__type_traits/type_identity.h>
#include <__utility/declval.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pra
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
huixie90 wrote:
FWIW, I created patch https://github.com/llvm/llvm-project/pull/141408 to
implement the libc++ counter part of the missing bit.
So can i request to merge this patch after landing of my patch? the benifits
are :
- Avoid behaviour differences between the two branches
- having mor
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
https://github.com/huixie90 edited
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/huixie90 edited
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
https://github.com/philnik777 updated
https://github.com/llvm/llvm-project/pull/121199
>From 97d6d6918126493fc8c09d9f3af472d701cb2cf9 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/docs/Lan
https://github.com/philnik777 updated
https://github.com/llvm/llvm-project/pull/121199
>From 273d0e6149a8326284ec1e385e83c8728c41ff68 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/docs/Lan
@@ -145,8 +160,6 @@ struct __common_reference_sub_bullet1<_Tp, _Up> {
philnik777 wrote:
I've added one.
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:/
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
https://github.com/huixie90 edited
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/huixie90 edited
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S,
TemplateName BaseTemplate,
}
}
+static QualType CopyCV(QualType From, QualType To) {
+ if (From.isConstQualified())
+To.addConst();
+ if (From.isVolatileQualified())
+To.addVolatile();
+ retur
@@ -145,8 +160,6 @@ struct __common_reference_sub_bullet1<_Tp, _Up> {
huixie90 wrote:
The origin line 156 does not match the new builtin implementation. the pointer
bit is missing as P2655R3 is not implemented . do we have a test?
https://github.com/llvm/llvm
https://github.com/huixie90 requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/philnik777 ready_for_review
https://github.com/llvm/llvm-project/pull/121199
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
Changes
---
Patch is 40.04 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/121199.diff
9 Files Affected:
- (modified) clang/docs/Lang
https://github.com/philnik777 updated
https://github.com/llvm/llvm-project/pull/121199
>From 19a76935988b306201ed536e99e9094b18006a0f Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/docs/Lan
https://github.com/philnik777 updated
https://github.com/llvm/llvm-project/pull/121199
>From 3010ba7ab5392394b37261807fc7cf4cbb205e0c Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/docs/Lan
https://github.com/philnik777 updated
https://github.com/llvm/llvm-project/pull/121199
>From 55f9d1e5abf5f217e58988742bd7f375d744beb8 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/docs/Lan
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 f334db92be168876b618db72dc93078ce23ffa89
e0db7316b2705398a2ac7e69cd1e3e83ece52613 --e
https://github.com/philnik777 created
https://github.com/llvm/llvm-project/pull/121199
None
>From e0db7316b2705398a2ac7e69cd1e3e83ece52613 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser
Date: Fri, 27 Sep 2024 22:11:14 +0200
Subject: [PATCH] [Clang] Add __builtin_common_reference
---
clang/do
39 matches
Mail list logo