@@ -67,6 +68,69 @@ void B::g() requires true;
} // namespace cwg2847
+namespace cwg2851 { // cwg2851: 19
+
+#if __cplusplus >= 202002L
+template struct Val { static constexpr T value = v; };
+
+
+// Floating-point promotions
+
+static_assert(Val::value == 0.0L);
@@ -67,6 +68,69 @@ void B::g() requires true;
} // namespace cwg2847
+namespace cwg2851 { // cwg2851: 19
+
+#if __cplusplus >= 202002L
+template struct Val { static constexpr T value = v; };
+
+
+// Floating-point promotions
+
+static_assert(Val::value == 0.0L);
@@ -67,6 +68,69 @@ void B::g() requires true;
} // namespace cwg2847
+namespace cwg2851 { // cwg2851: 19
+
+#if __cplusplus >= 202002L
+template struct Val { static constexpr T value = v; };
+
+
+// Floating-point promotions
+
+static_assert(Val::value == 0.0L);
https://github.com/MitalAshok updated
https://github.com/llvm/llvm-project/pull/90387
>From 77cb28e6faf95f5beb3fadc225cb5f0525b3dfe6 Mon Sep 17 00:00:00 2001
From: Mital Ashok
Date: Sun, 28 Apr 2024 09:48:47 +0100
Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in
https://github.com/MitalAshok updated
https://github.com/llvm/llvm-project/pull/90387
>From 0b8176cf2171da0ce780c15131e19a24473a6989 Mon Sep 17 00:00:00 2001
From: Mital Ashok
Date: Sun, 28 Apr 2024 09:48:47 +0100
Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in
Endilll wrote:
https://github.com/llvm/llvm-project/pull/90352 has been merged.
https://github.com/llvm/llvm-project/pull/90387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema
, Expr *From,
if (Result.isInvalid())
return Result;
- // Check for a narrowing implicit conversion.
+ if (SCS->Second == ICK_Floating_Conversion) {
Sirraide wrote:
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema
, Expr *From,
if (Result.isInvalid())
return Result;
- // Check for a narrowing implicit conversion.
+ if (SCS->Second == ICK_Floating_Conversion) {
MitalAshok wrote:
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema
, Expr *From,
if (Result.isInvalid())
return Result;
- // Check for a narrowing implicit conversion.
+ if (SCS->Second == ICK_Floating_Conversion) {
Sirraide wrote:
‘all
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema
, Expr *From,
if (Result.isInvalid())
return Result;
- // Check for a narrowing implicit conversion.
+ if (SCS->Second == ICK_Floating_Conversion) {
Sirraide wrote:
Is
https://github.com/Sirraide commented:
The approach here looks correct, but I’m not sure it’s in the right place.
https://github.com/llvm/llvm-project/pull/90387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/90387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
MitalAshok wrote:
Waiting on #90352 because it's not on the cxx_dr_status page yet
(`make_dr_status` doesn't do anything)
https://github.com/llvm/llvm-project/pull/90387
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/MitalAshok updated
https://github.com/llvm/llvm-project/pull/90387
>From 13e2943dea677daf8976ab55a673d43982ac8a4c Mon Sep 17 00:00:00 2001
From: Mital Ashok
Date: Sun, 28 Apr 2024 09:48:47 +0100
Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in
https://github.com/MitalAshok updated
https://github.com/llvm/llvm-project/pull/90387
>From a87399f8a41bb7d9a61c2d44c75836d86c6b4c38 Mon Sep 17 00:00:00 2001
From: Mital Ashok
Date: Sun, 28 Apr 2024 09:48:47 +0100
Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in
https://github.com/Endilll commented:
I'm fine with the way DR test is written, but I'm not qualified to review the
contents on the test, unfortunately.
I'd like to point to related Core issues
[CWG2836](https://cplusplus.github.io/CWG/issues/2836.html) and
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Mital Ashok (MitalAshok)
Changes
https://cplusplus.github.io/CWG/issues/2851.html
The only time the target type for a converted constant expression is a
floating-point type is in a NTTP, so this only affects C++20+.
---
Full diff:
https://github.com/MitalAshok created
https://github.com/llvm/llvm-project/pull/90387
https://cplusplus.github.io/CWG/issues/2851.html
The only time the target type for a converted constant expression is a
floating-point type is in a NTTP, so this only affects C++20+.
>From
18 matches
Mail list logo