[clang] Avoid printing overly large integer. (PR #75902)

2023-12-19 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung created 
https://github.com/llvm/llvm-project/pull/75902

Created a PR to fix issue #71675

>From 0eb58740f33f2eef29c28e43e78118f9f0eea4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Tue, 19 Dec 2023 00:03:28 -0800
Subject: [PATCH] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-21 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 0eb58740f33f2eef29c28e43e78118f9f0eea4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Tue, 19 Dec 2023 00:03:28 -0800
Subject: [PATCH 1/2] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 5e6326fb1cf4f1591fe927c94b1d16d1a7be0e66 Mon Sep 17 00:00:00 2001
From: Nhat Nguyen 
Date: Thu, 21 Dec 2023 13:26:13 -0500
Subject: [PATCH 2/2] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-21 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

Thanks, I will look into adding tests! 

Regarding the floating point option, are we converting the value to float type 
and just print it to the output stream? @cor3ntin 

https://github.com/llvm/llvm-project/pull/75902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-21 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 0eb58740f33f2eef29c28e43e78118f9f0eea4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Tue, 19 Dec 2023 00:03:28 -0800
Subject: [PATCH 1/3] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 5e6326fb1cf4f1591fe927c94b1d16d1a7be0e66 Mon Sep 17 00:00:00 2001
From: Nhat Nguyen 
Date: Thu, 21 Dec 2023 13:26:13 -0500
Subject: [PATCH 2/3] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From b2794aba6969d694b55ab3a91ac1616f8469cd46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Thu, 21 Dec 2023 10:34:00 -0800
Subject: [PATCH 3/3] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-21 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 0eb58740f33f2eef29c28e43e78118f9f0eea4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Tue, 19 Dec 2023 00:03:28 -0800
Subject: [PATCH 1/4] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 5e6326fb1cf4f1591fe927c94b1d16d1a7be0e66 Mon Sep 17 00:00:00 2001
From: Nhat Nguyen 
Date: Thu, 21 Dec 2023 13:26:13 -0500
Subject: [PATCH 2/4] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From b2794aba6969d694b55ab3a91ac1616f8469cd46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Thu, 21 Dec 2023 10:34:00 -0800
Subject: [PATCH 3/4] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From d5208f02c9b130b85c15b32c945f871d0216885a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= <“nhat7...@gmail.com”>
Date: Thu, 21 Dec 2023 23:14:44 -0800
Subject: [PATCH 4/4] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 323890b38daeec..80e6cd9ee07420 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || 
+  if (V.getInt() > std::numeric_limits::max() ||
   V.getInt() < std::numeric_limits::min()) {
 return false;
   }

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-26 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

Thanks everyone for the comments! I will address as soon as I can. 

https://github.com/llvm/llvm-project/pull/75902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2023-12-27 Thread Nhat Nguyen via cfe-commits


@@ -17132,6 +17132,10 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() > std::numeric_limits::max() ||

changkhothuychung wrote:

Hi, do you have any idea where is actually the right place to fix the code? I 
am still looking for it, but if you have found it, it would be really 
appreciated!

https://github.com/llvm/llvm-project/pull/75902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2024-01-01 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= 
Message-ID:
In-Reply-To: 


https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 4939edb1cb2b73f9c60c4cce0803fab4888beb6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:26 -0500
Subject: [PATCH 1/4] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 1932765f174e187a79144c4fd69657dc7bae480a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:27 -0500
Subject: [PATCH 2/4] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From 69e21b2bf76b51914f835c74af9e2b3c685ffae0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:28 -0500
Subject: [PATCH 3/4] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From ac93beb74cbe6e0cb6383ece6b72b59b00aeca0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:29 -0500
Subject: [PATCH 4/4] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 323890b38daeec..80e6cd9ee07420 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || 
+  if (V.getInt() > std::numeric_limits::max() ||
   V.getInt() < std::numeric_limits::min()) {
 return false;
   }

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2024-01-01 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= 
Message-ID:
In-Reply-To: 


https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 4939edb1cb2b73f9c60c4cce0803fab4888beb6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:26 -0500
Subject: [PATCH 1/5] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 1932765f174e187a79144c4fd69657dc7bae480a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:27 -0500
Subject: [PATCH 2/5] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From 69e21b2bf76b51914f835c74af9e2b3c685ffae0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:28 -0500
Subject: [PATCH 3/5] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From ac93beb74cbe6e0cb6383ece6b72b59b00aeca0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:29 -0500
Subject: [PATCH 4/5] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 323890b38daeec..80e6cd9ee07420 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || 
+  if (V.getInt() > std::numeric_limits::max() ||
   V.getInt() < std::numeric_limits::min()) {
 return false;
   }

>From 35773add17d8b4e884daac0e3e7dc312f1947911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 21:09:21 -0500
Subject: [PATCH 5/5] move the condition right under toString

---
 clang/lib/Sema/SemaDeclCXX.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 80e6cd9ee07420..d3b68c9aa95645 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,10 +17132,6 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::n

[clang] Avoid printing overly large integer. (PR #75902)

2024-01-01 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= 
Message-ID:
In-Reply-To: 



@@ -17132,6 +17132,10 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() > std::numeric_limits::max() ||

changkhothuychung wrote:

@ShamrockLee 

thanks for letting me know! I have moved the code overthere, however it looks 
like there are some failed tests, is it because of my code which causes the 
error? 

https://github.com/llvm/llvm-project/pull/75902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Avoid printing overly large integer. (PR #75902)

2024-02-10 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= 
Message-ID:
In-Reply-To: 


https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 4939edb1cb2b73f9c60c4cce0803fab4888beb6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:26 -0500
Subject: [PATCH 1/6] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 1932765f174e187a79144c4fd69657dc7bae480a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:27 -0500
Subject: [PATCH 2/6] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From 69e21b2bf76b51914f835c74af9e2b3c685ffae0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:28 -0500
Subject: [PATCH 3/6] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From ac93beb74cbe6e0cb6383ece6b72b59b00aeca0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:29 -0500
Subject: [PATCH 4/6] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 323890b38daeec..80e6cd9ee07420 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || 
+  if (V.getInt() > std::numeric_limits::max() ||
   V.getInt() < std::numeric_limits::min()) {
 return false;
   }

>From 35773add17d8b4e884daac0e3e7dc312f1947911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 21:09:21 -0500
Subject: [PATCH 5/6] move the condition right under toString

---
 clang/lib/Sema/SemaDeclCXX.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 80e6cd9ee07420..d3b68c9aa95645 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,10 +17132,6 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if 

[clang] Avoid printing overly large integer. (PR #75902)

2024-02-11 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,Nhat Nguyen
 
Message-ID:
In-Reply-To: 


https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/75902

>From 4939edb1cb2b73f9c60c4cce0803fab4888beb6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:26 -0500
Subject: [PATCH 1/7] return false if the value is too large

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a3f68d4ffc0f6e..18631ec7dac152 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,6 +17132,9 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
+  if (V.getInt() >= (1 << 64)) {
+return false;
+  }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());
   WriteCharTypePrefix(BTy->getKind(), OS);
   OS << '\'';

>From 1932765f174e187a79144c4fd69657dc7bae480a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:27 -0500
Subject: [PATCH 2/7] Update clang/lib/Sema/SemaDeclCXX.cpp

Co-authored-by: Yueh-Shun Li 
---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 18631ec7dac152..196e32a4a349f2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() >= (1 << 64)) {
+  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From 69e21b2bf76b51914f835c74af9e2b3c685ffae0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:28 -0500
Subject: [PATCH 3/7] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 196e32a4a349f2..323890b38daeec 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,8 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || V.getInt() 
< std::numeric_limits::min()) {
+  if (V.getInt() > std::numeric_limits::max() || 
+  V.getInt() < std::numeric_limits::min()) {
 return false;
   }
   uint32_t CodeUnit = static_cast(V.getInt().getZExtValue());

>From ac93beb74cbe6e0cb6383ece6b72b59b00aeca0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 20:59:29 -0500
Subject: [PATCH 4/7] clang format

---
 clang/lib/Sema/SemaDeclCXX.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 323890b38daeec..80e6cd9ee07420 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,7 +17132,7 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");
-  if (V.getInt() > std::numeric_limits::max() || 
+  if (V.getInt() > std::numeric_limits::max() ||
   V.getInt() < std::numeric_limits::min()) {
 return false;
   }

>From 35773add17d8b4e884daac0e3e7dc312f1947911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CNhat?= 
Date: Mon, 1 Jan 2024 21:09:21 -0500
Subject: [PATCH 5/7] move the condition right under toString

---
 clang/lib/Sema/SemaDeclCXX.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 80e6cd9ee07420..d3b68c9aa95645 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -17132,10 +17132,6 @@ static bool ConvertAPValueToString(const APValue &V, 
QualType T,
 case BuiltinType::WChar_U: {
   unsigned TyWidth = Context.getIntWidth(T);
   assert(8 <= TyWidth && TyWidth <= 32 && "Unexpected integer width");

[clang] Avoid printing overly large integer. (PR #75902)

2024-02-12 Thread Nhat Nguyen via cfe-commits
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,
=?utf-8?q?“Nhat?= ,Nhat Nguyen
 
Message-ID:
In-Reply-To: 


changkhothuychung wrote:

> Looks like all the tests disappeared? Only thing I see is the code change. 
> Also, no release note is currently present.

Hi I am still slowly working on it. I am not familiar with the release note. 
Can you provide me some pointers so I can follow accordingly? Thanks a lot. 

https://github.com/llvm/llvm-project/pull/75902
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-30 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-30 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-06 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,623 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+namespace ranges {
+
+template 
+struct __extract_last : __extract_last<_Tail...> {};

changkhothuychung wrote:

How can we do this? Can you give me some pointers?

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-06 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-07 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-01-07 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,54 @@
+//===--===//
+//
+// 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: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17

changkhothuychung wrote:

Hi, can you elaborate a bit more, what do I need to change in these test files? 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-27 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-30 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-05 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

@frederick-vs-ja
just follow up on this

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung ready_for_review 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung converted_to_draft 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung created 
https://github.com/llvm/llvm-project/pull/120920

None

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-22 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-01-08 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-01-08 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-01-08 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,637 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+namespace ranges {
+
+#  ifdef __cpp_pack_indexing
+template 
+using __extract_last = _Tp...[sizeof...(_Tp) - 1];
+#  else
+template 
+struct __extract_last_impl : __extract_last_impl<_Tail...> {};
+template 
+struct __extract_last_impl<_Tp> {
+  using type = _Tp;
+};
+
+template 
+using __extract_last = __extract_last_impl<_Tp...>::type;
+#  endif
+
+template 
+constexpr bool __derived_from_pack =
+__derived_from_pack<_Tp, __extract_last<_Tail...>> && 
__derived_from_pack<_Tail...>;
+
+template 
+constexpr bool __derived_from_pack<_Tp, _IterCategory> = derived_from<_Tp, 
_IterCategory>;
+
+template 
+struct __last_view : __last_view<_Views...> {};
+
+template 
+struct __last_view<_View> {
+  using type = _View;
+};
+
+template 
+concept __concat_indirectly_readable_impl = requires(const _It __it) {
+  { *__it } -> convertible_to<_Ref>;
+  { ranges::iter_move(__it) } -> convertible_to<_RRef>;
+};
+
+template 
+using __concat_reference_t = common_reference_t...>;
+
+template 
+using __concat_value_t = common_type_t...>;
+
+template 
+using __concat_rvalue_reference_t = 
common_reference_t...>;
+
+template 
+concept __concat_indirectly_readable =
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...>&> &&
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_rvalue_reference_t<_Rs...>&&> &&
+common_reference_with<__concat_rvalue_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...> const&> &&
+(__concat_indirectly_readable_impl<__concat_reference_t<_Rs...>,
+   __concat_rvalue_reference_t<_Rs...>,
+   iterator_t<_Rs>> &&
+ ...);
+
+template 
+concept __concatable = requires {
+  typename __concat_reference_t<_Rs...>;
+  typename __concat_value_t<_Rs...>;
+  typename __concat_rvalue_reference_t<_Rs...>;
+} && __concat_indirectly_readable<_Rs...>;
+
+template 
+concept __concat_is_random_access =
+(random_access_range<__maybe_const<_Const, _Rs>> && ...) && 
(sized_range<__maybe_const<_Const, _Rs>> && ...);
+
+template 
+concept __concat_is_bidirectional =
+((bidirectional_range<__maybe_const<_Const, _Rs>> && ...) && 
(common_range<__maybe_const<_Const, _Rs>> && ...));
+
+template 
+concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
+
+template 
+struct __apply_drop_first;
+
+template 
+struct __apply_drop_first<_Const, _Head, _Tail...> {
+  static constexpr bool value = (sized_range<__maybe_const<_Const, _Tail>> && 
...);
+};
+
+template 
+  requires(view<_Views> && ...) && (sizeof...(_Views) > 0) && 
__concatable<_Views...>
+class concat_view : public view_interface> {
+  tuple<_Views...> __views_;
+
+  template 
+  class __iterator;
+
+public:
+  _LI

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-01-10 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-04 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-03 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,623 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+

changkhothuychung wrote:

Thanks! I will continue to incrementally fix those. 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-03 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,623 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+namespace ranges {
+
+template 
+struct __extract_last : __extract_last<_Tail...> {};

changkhothuychung wrote:

Thanks, I will update that, please let me know if there are any other C++ 26 
features that I should adopt.

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-03 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-03 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-03 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-04 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-04 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libcxx] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

I have no idea why I am getting `error: no type named 'concat_view' in 
namespace 'std::ranges'` in the buildkite. My test runs successfully locally. 
Does anyone know what is wrong? 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2024-12-23 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-07 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-07 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] implement views::concat (PR #120920)

2025-01-07 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-14 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

> > @frederick-vs-ja just follow up on this, is there anything else I need to 
> > address for this PR?
> 
> It looks like you are missing the Release Notes entry, FTM is not set, etc. 
> house keeping stuff. Please check some other complete PRs for what else you 
> need to do.

What's FTM? Can you give me an example PR that has those? 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

> #105419

I think let's address LWG4082 in another PR for better tracking? 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-15 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

> @changkhothuychung The be more specific. You should add the paper entry here:
> 
> https://github.com/llvm/llvm-project/blob/4887e41055686eede9c155e6b3296b92fe86c2d5/libcxx/docs/ReleaseNotes/21.rst?plain=1#L41
> 
> 
> And update the status accordingly:
> https://github.com/llvm/llvm-project/blob/4887e41055686eede9c155e6b3296b92fe86c2d5/libcxx/docs/Status/Cxx2cPapers.csv?plain=1#L57
> 
> It also looks like there are additional related LWGs that you should 
> implement probably :
> 
> https://github.com/llvm/llvm-project/blob/4887e41055686eede9c155e6b3296b92fe86c2d5/libcxx/docs/Status/Cxx2cIssues.csv?plain=1#L72

I think let's address LWG4082 in another PR for better tracking? 

https://github.com/llvm/llvm-project/pull/120920
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of bind rvalue ref to const lvalue ref (PR #133035)

2025-03-26 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/133035

>From fb9260dd796ae687a000beb550198d155b772625 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 00:55:26 -0400
Subject: [PATCH 1/3] initial commit

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,

>From 693049e2bdfe31c1243c9d9a5a7bf59363a2b9b1 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 01:59:45 -0400
Subject: [PATCH 2/3] bound rref to const lref

---
 clang/lib/Sema/SemaOverload.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 28843f378c686..0f4bb69f713f8 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,
@@ -5450,6 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
+if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
+}
+
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;
 ICS.UserDefined.After.BindsToFunctionLvalue = false;

>From 01f5ee3e019a69f42aa22394e2aa9dd79b47c7ca Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:16:03 -0400
Subject: [PATCH 3/3] clang-format

---
 clang/lib/Sema/SemaOverload.cpp | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0f4bb69f713f8..5539934aef7f9 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5450,10 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
-if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
-  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
-  return ICS;
-}
+if (isRValRef && ICS.UserDefined.ConversionFunction->getReturnType()
+ .isConstQualified()) {
+   ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+   return ICS;
+ }
 
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/133035

>From fb9260dd796ae687a000beb550198d155b772625 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 00:55:26 -0400
Subject: [PATCH 1/4] initial commit

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,

>From 693049e2bdfe31c1243c9d9a5a7bf59363a2b9b1 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 01:59:45 -0400
Subject: [PATCH 2/4] bound rref to const lref

---
 clang/lib/Sema/SemaOverload.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 28843f378c686..0f4bb69f713f8 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,
@@ -5450,6 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
+if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
+}
+
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;
 ICS.UserDefined.After.BindsToFunctionLvalue = false;

>From 01f5ee3e019a69f42aa22394e2aa9dd79b47c7ca Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:16:03 -0400
Subject: [PATCH 3/4] clang-format

---
 clang/lib/Sema/SemaOverload.cpp | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0f4bb69f713f8..5539934aef7f9 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5450,10 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
-if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
-  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
-  return ICS;
-}
+if (isRValRef && ICS.UserDefined.ConversionFunction->getReturnType()
+ .isConstQualified()) {
+   ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+   return ICS;
+ }
 
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;

>From 36e6aa95a043bb4c9fe2275d331dc164fca43241 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:26:22 -0400
Subject: [PATCH 4/4] clang format

---
 clang/lib/Sema/SemaOverload.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 5539934aef7f9..c0e4a8ab51d05 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5452,8 +5452,8 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
 
 if (isRValRef && ICS.UserDefined.ConversionFunction->getReturnType()
  .isConstQualified()) {
-   ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
-   return ICS;
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
  }
 
 ICS.UserDefined.After.ReferenceBinding = true;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung ready_for_review 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/133035

>From fb9260dd796ae687a000beb550198d155b772625 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 00:55:26 -0400
Subject: [PATCH 1/5] initial commit

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,

>From 693049e2bdfe31c1243c9d9a5a7bf59363a2b9b1 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 01:59:45 -0400
Subject: [PATCH 2/5] bound rref to const lref

---
 clang/lib/Sema/SemaOverload.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 28843f378c686..0f4bb69f713f8 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,
@@ -5450,6 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
+if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
+}
+
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;
 ICS.UserDefined.After.BindsToFunctionLvalue = false;

>From 01f5ee3e019a69f42aa22394e2aa9dd79b47c7ca Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:16:03 -0400
Subject: [PATCH 3/5] clang-format

---
 clang/lib/Sema/SemaOverload.cpp | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 0f4bb69f713f8..5539934aef7f9 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5450,10 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
-if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
-  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
-  return ICS;
-}
+if (isRValRef && ICS.UserDefined.ConversionFunction->getReturnType()
+ .isConstQualified()) {
+   ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+   return ICS;
+ }
 
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;

>From 36e6aa95a043bb4c9fe2275d331dc164fca43241 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:26:22 -0400
Subject: [PATCH 4/5] clang format

---
 clang/lib/Sema/SemaOverload.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 5539934aef7f9..c0e4a8ab51d05 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5452,8 +5452,8 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
 
 if (isRValRef && ICS.UserDefined.ConversionFunction->getReturnType()
  .isConstQualified()) {
-   ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
-   return ICS;
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
  }
 
 ICS.UserDefined.After.ReferenceBinding = true;

>From 2b7ec8dcab7f4279da4a5ef2cc54764970a5f721 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 02:30:08 -0400
Subject: [PATCH 5/5] clang format

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverloa

[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

changkhothuychung wrote:

the failing test in clang/test/SemaCXX/copy-assignment.cpp seems like to be 
another clang bug -  https://godbolt.org/z/79bWMscx9

https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung created 
https://github.com/llvm/llvm-project/pull/133035

fix #132600


>From fb9260dd796ae687a000beb550198d155b772625 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 00:55:26 -0400
Subject: [PATCH] initial commit

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung converted_to_draft 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/133035

>From fb9260dd796ae687a000beb550198d155b772625 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 00:55:26 -0400
Subject: [PATCH 1/2] initial commit

---
 clang/lib/Sema/SemaOverload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,

>From 693049e2bdfe31c1243c9d9a5a7bf59363a2b9b1 Mon Sep 17 00:00:00 2001
From: changkhothuychung 
Date: Wed, 26 Mar 2025 01:59:45 -0400
Subject: [PATCH 2/2] bound rref to const lref

---
 clang/lib/Sema/SemaOverload.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 28843f378c686..0f4bb69f713f8 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
   AllowedExplicit::None,
   /*InOverloadResolution=*/false,
   /*CStyle=*/false,
@@ -5450,6 +5450,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   return ICS;
 }
 
+if (isRValRef && 
ICS.UserDefined.ConversionFunction->getReturnType().isConstQualified()) {
+  ICS.setBad(BadConversionSequence::no_conversion, Init, DeclType);
+  return ICS;
+}
+
 ICS.UserDefined.After.ReferenceBinding = true;
 ICS.UserDefined.After.IsLvalueReference = !isRValRef;
 ICS.UserDefined.After.BindsToFunctionLvalue = false;

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

2025-03-25 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix overload resolution in case of bind rvalue ref to const lvalue ref (PR #133035)

2025-03-26 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang]: fix reference compatibility in overload resolution (PR #133035)

2025-04-06 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung edited 
https://github.com/llvm/llvm-project/pull/133035
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-03-01 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,646 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+namespace ranges {
+
+#  ifdef __cpp_pack_indexing
+template 
+using __extract_last _LIBCPP_NODEBUG = _Tp...[sizeof...(_Tp) - 1];
+#  else
+template 
+struct __extract_last_impl : __extract_last_impl<_Tail...> {};
+template 
+struct __extract_last_impl<_Tp> {
+  using type _LIBCPP_NODEBUG = _Tp;
+};
+
+template 
+using __extract_last _LIBCPP_NODEBUG = __extract_last_impl<_Tp...>::type;
+#  endif
+
+template 
+constexpr bool __derived_from_pack =
+__derived_from_pack<_Tp, __extract_last<_Tail...>> && 
__derived_from_pack<_Tail...>;
+
+template 
+constexpr bool __derived_from_pack<_Tp, _IterCategory> = derived_from<_Tp, 
_IterCategory>;
+
+template 
+struct __last_view : __last_view<_Views...> {};
+
+template 
+struct __last_view<_View> {
+  using type = _View;
+};
+
+template 
+concept __concat_indirectly_readable_impl = requires(const _It __it) {
+  { *__it } -> convertible_to<_Ref>;
+  { ranges::iter_move(__it) } -> convertible_to<_RRef>;
+};
+
+template 
+using __concat_reference_t _LIBCPP_NODEBUG = 
common_reference_t...>;
+
+template 
+using __concat_value_t _LIBCPP_NODEBUG = common_type_t...>;
+
+template 
+using __concat_rvalue_reference_t _LIBCPP_NODEBUG = 
common_reference_t...>;
+
+template 
+concept __concat_indirectly_readable =
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...>&> &&
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_rvalue_reference_t<_Rs...>&&> &&
+common_reference_with<__concat_rvalue_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...> const&> &&
+(__concat_indirectly_readable_impl<__concat_reference_t<_Rs...>,
+   __concat_rvalue_reference_t<_Rs...>,
+   iterator_t<_Rs>> &&
+ ...);
+
+template 
+concept __concatable = requires {
+  typename __concat_reference_t<_Rs...>;
+  typename __concat_value_t<_Rs...>;
+  typename __concat_rvalue_reference_t<_Rs...>;
+} && __concat_indirectly_readable<_Rs...>;
+
+template 
+concept __concat_is_random_access =
+(random_access_range<__maybe_const<_Const, _Rs>> && ...) && 
(sized_range<__maybe_const<_Const, _Rs>> && ...);
+
+template 
+concept __concat_is_bidirectional =
+((bidirectional_range<__maybe_const<_Const, _Rs>> && ...) && 
(common_range<__maybe_const<_Const, _Rs>> && ...));
+
+template 
+concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
+
+template 
+struct __apply_drop_first;
+
+template 
+struct __apply_drop_first<_Const, _Head, _Tail...> {
+  static constexpr bool value = (sized_range<__maybe_const<_Const, _Tail>> && 
...);
+};
+
+template 
+  requires(view<_Views> && ...) && (sizeof...(_Views) > 0) && 
__concatable<_Views...>
+class concat_view : public view

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-03-01 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-03-03 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-28 Thread Nhat Nguyen via cfe-commits


@@ -0,0 +1,646 @@
+// -*- C++ -*-
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef _LIBCPP___RANGES_CONCAT_VIEW_H
+#define _LIBCPP___RANGES_CONCAT_VIEW_H
+
+#include <__algorithm/ranges_find_if.h>
+#include <__assert>
+#include <__concepts/common_reference_with.h>
+#include <__concepts/constructible.h>
+#include <__concepts/convertible_to.h>
+#include <__concepts/copyable.h>
+#include <__concepts/derived_from.h>
+#include <__concepts/equality_comparable.h>
+#include <__concepts/swappable.h>
+#include <__config>
+#include <__functional/bind_back.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__iterator/concepts.h>
+#include <__iterator/default_sentinel.h>
+#include <__iterator/distance.h>
+#include <__iterator/incrementable_traits.h>
+#include <__iterator/iter_move.h>
+#include <__iterator/iter_swap.h>
+#include <__iterator/iterator_traits.h>
+#include <__iterator/next.h>
+#include <__memory/addressof.h>
+#include <__ranges/access.h>
+#include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/movable_box.h>
+#include <__ranges/non_propagating_cache.h>
+#include <__ranges/range_adaptor.h>
+#include <__ranges/size.h>
+#include <__ranges/view_interface.h>
+#include <__ranges/zip_view.h>
+#include <__type_traits/conditional.h>
+#include <__type_traits/decay.h>
+#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_nothrow_convertible.h>
+#include <__type_traits/is_object.h>
+#include <__type_traits/make_unsigned.h>
+#include <__type_traits/maybe_const.h>
+#include <__utility/forward.h>
+#include <__utility/in_place.h>
+#include <__utility/move.h>
+#include 
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+
+namespace ranges {
+
+#  ifdef __cpp_pack_indexing
+template 
+using __extract_last _LIBCPP_NODEBUG = _Tp...[sizeof...(_Tp) - 1];
+#  else
+template 
+struct __extract_last_impl : __extract_last_impl<_Tail...> {};
+template 
+struct __extract_last_impl<_Tp> {
+  using type _LIBCPP_NODEBUG = _Tp;
+};
+
+template 
+using __extract_last _LIBCPP_NODEBUG = __extract_last_impl<_Tp...>::type;
+#  endif
+
+template 
+constexpr bool __derived_from_pack =
+__derived_from_pack<_Tp, __extract_last<_Tail...>> && 
__derived_from_pack<_Tail...>;
+
+template 
+constexpr bool __derived_from_pack<_Tp, _IterCategory> = derived_from<_Tp, 
_IterCategory>;
+
+template 
+struct __last_view : __last_view<_Views...> {};
+
+template 
+struct __last_view<_View> {
+  using type = _View;
+};
+
+template 
+concept __concat_indirectly_readable_impl = requires(const _It __it) {
+  { *__it } -> convertible_to<_Ref>;
+  { ranges::iter_move(__it) } -> convertible_to<_RRef>;
+};
+
+template 
+using __concat_reference_t _LIBCPP_NODEBUG = 
common_reference_t...>;
+
+template 
+using __concat_value_t _LIBCPP_NODEBUG = common_type_t...>;
+
+template 
+using __concat_rvalue_reference_t _LIBCPP_NODEBUG = 
common_reference_t...>;
+
+template 
+concept __concat_indirectly_readable =
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...>&> &&
+common_reference_with<__concat_reference_t<_Rs...>&&, 
__concat_rvalue_reference_t<_Rs...>&&> &&
+common_reference_with<__concat_rvalue_reference_t<_Rs...>&&, 
__concat_value_t<_Rs...> const&> &&
+(__concat_indirectly_readable_impl<__concat_reference_t<_Rs...>,
+   __concat_rvalue_reference_t<_Rs...>,
+   iterator_t<_Rs>> &&
+ ...);
+
+template 
+concept __concatable = requires {
+  typename __concat_reference_t<_Rs...>;
+  typename __concat_value_t<_Rs...>;
+  typename __concat_rvalue_reference_t<_Rs...>;
+} && __concat_indirectly_readable<_Rs...>;
+
+template 
+concept __concat_is_random_access =
+(random_access_range<__maybe_const<_Const, _Rs>> && ...) && 
(sized_range<__maybe_const<_Const, _Rs>> && ...);
+
+template 
+concept __concat_is_bidirectional =
+((bidirectional_range<__maybe_const<_Const, _Rs>> && ...) && 
(common_range<__maybe_const<_Const, _Rs>> && ...));
+
+template 
+concept __all_forward = (forward_range<__maybe_const<_Const, _Views>> && ...);
+
+template 
+struct __apply_drop_first;
+
+template 
+struct __apply_drop_first<_Const, _Head, _Tail...> {
+  static constexpr bool value = (sized_range<__maybe_const<_Const, _Tail>> && 
...);
+};
+
+template 
+  requires(view<_Views> && ...) && (sizeof...(_Views) > 0) && 
__concatable<_Views...>
+class concat_view : public view

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-26 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-28 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] constexpr deque (PR #129367)

2025-02-28 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung closed 
https://github.com/llvm/llvm-project/pull/129367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++] constexpr deque (PR #129367)

2025-03-01 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung created 
https://github.com/llvm/llvm-project/pull/129367

None

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-03-01 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-03-01 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread Nhat Nguyen via cfe-commits

https://github.com/changkhothuychung updated 
https://github.com/llvm/llvm-project/pull/120920

error: too big or took too long to generate
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   >