[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-12-01 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-12-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-30 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-30 Thread via cfe-commits
@@ -6226,6 +6226,15 @@ ExprResult Sema::CheckConvertedConstantExpression(Expr *From, QualType T, return R; } +ExprResult Sema::EvaluateConvertedConstantExpression(Expr *E, QualType T, + APValue &Value, +

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/73103 >From 074d18d3805b067a5442bea94816d01319a29083 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 22 Nov 2023 11:43:07 +0100 Subject: [PATCH 1/5] [Clang] Implement P2308R1 - Template Parameter Initializat

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
@@ -6226,6 +6226,15 @@ ExprResult Sema::CheckConvertedConstantExpression(Expr *From, QualType T, return R; } +ExprResult Sema::EvaluateConvertedConstantExpression(Expr *E, QualType T, + APValue &Value, +

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/73103 >From 4709819fb2e7f45f9429f1a7fc79923abf0f9691 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 22 Nov 2023 11:43:07 +0100 Subject: [PATCH 1/4] [Clang] Implement P2308R1 - Template Parameter Initializat

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Tom Honermann via cfe-commits
@@ -61,6 +61,14 @@ namespace dr2026 { // dr2026: 11 } } +namespace dr2049 { // dr2049: 18 drafting +#if __cplusplus > 202002L +template struct X {}; +X<> a; +X b; tahonermann wrote: Perhaps add a same-type static assertion for `a` and `b` to ensure a consi

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann commented: Looks like good work to me! https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann edited https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/73103 >From 4709819fb2e7f45f9429f1a7fc79923abf0f9691 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 22 Nov 2023 11:43:07 +0100 Subject: [PATCH 1/3] [Clang] Implement P2308R1 - Template Parameter Initializat

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/73103 >From 4709819fb2e7f45f9429f1a7fc79923abf0f9691 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 22 Nov 2023 11:43:07 +0100 Subject: [PATCH 1/2] [Clang] Implement P2308R1 - Template Parameter Initializat

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -62,7 +62,7 @@ namespace ClassNTTP { template constexpr int f() { return a.y; } static_assert(f() == 2); - template int id; + template int id; // expected-note {{passing argument to parameter 'a' here}} AaronBallman wrote: Ahhh, it was just out of s

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread via cfe-commits
@@ -62,7 +62,7 @@ namespace ClassNTTP { template constexpr int f() { return a.y; } static_assert(f() == 2); - template int id; + template int id; // expected-note {{passing argument to parameter 'a' here}} cor3ntin wrote: L70. you want me to use a labe

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors \ AaronBallman wrote: I don't think we need `-fexceptions -fcxx-exceptions -Wno-variadic-macros -Wno-c11-extensions` either.

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -62,7 +62,7 @@ namespace ClassNTTP { template constexpr int f() { return a.y; } static_assert(f() == 2); - template int id; + template int id; // expected-note {{passing argument to parameter 'a' here}} AaronBallman wrote: What diagnostic is this no

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I dont think the triple is necessary for the test, otherwise this LGTM! https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-22 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. DR test side looks good, except for a small nit. https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

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

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-22 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors \ Endilll wrote: Is triple necessary for the test? https://github.com/llvm/llvm-project/pull/73103 _

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes https://wiki.edg.com/pub/Wg21kona2023/StrawPolls/p2308r1.html This implements P2308R1 as a DR and resolves CWG2459, CWG2450 and CWG2049. --- Full diff: https://github.com/llvm/llvm-project/pull/73103.diff 11

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-11-22 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/73103 https://wiki.edg.com/pub/Wg21kona2023/StrawPolls/p2308r1.html This implements P2308R1 as a DR and resolves CWG2459, CWG2450 and CWG2049. >From 90a9c92ce532af7c6346a381499780f158cd26ca Mon Sep 17 00:00:00 2001 F