[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -711,11 +712,54 @@ void APValue::printPretty(raw_ostream &Out, const PrintingPolicy &Policy, case APValue::Indeterminate: Out << ""; return; - case APValue::Int: + case APValue::Int: { +const APSInt &Val = getInt(); +if (const EnumType *ET = Ty->getAs())

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -17256,6 +17378,56 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, OS << "i)"; } break; + case APValue::ValueKind::Array: + case APValue::ValueKind::Vector: { +llvm::raw_svector_ostream OS(Str); +// we hope to emit a valid initalizer exp

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -84,6 +84,7 @@ class DiagnosticOptions : public RefCountedBase{ DefaultMacroBacktraceLimit = 6, DefaultTemplateBacktraceLimit = 10, DefaultConstexprBacktraceLimit = 10, +DefaultConstexprValueSizeLimit = 320, cor3ntin wrote: 320? https://gi

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -17256,6 +17378,56 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, OS << "i)"; } break; + case APValue::ValueKind::Array: + case APValue::ValueKind::Vector: { +llvm::raw_svector_ostream OS(Str); +// we hope to emit a valid initalizer exp

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -17172,6 +17179,113 @@ static void WriteCharValueForDiagnostic(uint32_t Value, const BuiltinType *BTy, } } +/// A raw_ostream that clips its output beyond a certain size, inserting a cor3ntin wrote: I this we should move that to llvm/Support - either in

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-07 Thread via cfe-commits
@@ -17256,6 +17378,56 @@ static bool ConvertAPValueToString(const APValue &V, QualType T, OS << "i)"; } break; + case APValue::ValueKind::Array: + case APValue::ValueKind::Vector: { +llvm::raw_svector_ostream OS(Str); +// we hope to emit a valid initalizer exp

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-10-04 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-06-18 Thread Seth Pellegrino via cfe-commits
sethp wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-04-30 Thread via cfe-commits
sethp wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-19 Thread via cfe-commits
yronglin wrote: > @yronglin Thanks for introducing me to `__builtin_dump_struct`, that looks > useful! > > I'm not sure I see much in the way of overlap with this PR, though: would you > say more about what you mean? Is there maybe some commonality that you're > concerned might drift apart?

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-19 Thread via cfe-commits
sethp wrote: @yronglin Thanks for introducing me to `__builtin_dump_struct`, that looks useful! I'm not sure I see much in the way of overlap with this PR, though: would you say more about what you mean? Is there maybe some commonality that you're concerned might drift apart? https://github.

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-19 Thread via cfe-commits
yronglin wrote: FYI, Does this PR have some overlapping functions with `__builtin_dump_struct` in structure printing? https://github.com/llvm/llvm-project/blob/db4170a4f3a701a62f5c1ef2e6a30f490f107f7d/clang/lib/Sema/SemaChecking.cpp#L453-L695 https://github.com/llvm/llvm-project/pull/74852 ___

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-19 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/13] [Clang][Sema] Print more static_assert exprs This change int

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-15 Thread via cfe-commits
sethp wrote: Ping @cor3ntin @cjdb —this one definitely needs a rebase from me, but I don't want to do that if y'all have a review in progress. https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-15 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/12] [Clang][Sema] Print more static_assert exprs This change int

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-02-22 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-02-09 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/12] [Clang][Sema] Print more static_assert exprs This change int

[clang-tools-extra] [llvm] [clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-02-05 Thread via cfe-commits
sethp wrote: Looks like I missed the branch for v18 with this one, hence the conflict (now resolved), too bad. The test that's failing is looking for clang to emit some options that it's not; it looks like the same test is failing on main, so I haven't dug too deep into it. I believe I'm just

[clang-tools-extra] [llvm] [clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-19 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/12] [Clang][Sema] Print more static_assert exprs This change int

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this needs a 'merge' to get rid of the }}} patch changes from its diff, but I'm in favor of the patch otherwise. Probably could use a release note, and a look over @cor3ntin or @cjdb perhaps? https://github.com/llvm/llvm-project/pull/74852 ___

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-18 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/11] [Clang][Sema] Print more static_assert exprs This change int

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-17 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 01/10] [Clang][Sema] Print more static_assert exprs This change int

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-16 Thread via cfe-commits
sethp wrote: Yeah, definitely agree about adding no new issues like https://github.com/llvm/llvm-project/issues/71675 . The good news is that ought to make for an easy test case: something like `struct { _BitInt(__BITINT_MAXWIDTH__ >> 6) F }` should do it. I'll take a look! https://github.com

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-16 Thread Erich Keane via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-16 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > I think this change is useful enough on its own that I'd like us to consider > merging it: to me, teaching the compiler to do additional diffing or further > clarifying the structure of complicated sub-objects feel like they'd benefit > from having this work as a fallback.

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-16 Thread Erich Keane via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-14 Thread via cfe-commits
sethp wrote: I think this change is useful enough on its own that I'd like us to consider merging it: to me, teaching the compiler to do additional diffing or further clarifying the structure of complicated sub-objects feel like they'd benefit from having this work as a fallback. We could then

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-14 Thread via cfe-commits
@@ -0,0 +1,205 @@ +// RUN: %clang_cc1 -std=c++2a -verify -fsyntax-only -triple wasm32 %s +// RUN: %clang_cc1 -std=c++2a -verify -fsyntax-only -triple aarch64_be-linux-gnu %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 =

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-14 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/9] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
@@ -711,11 +712,54 @@ void APValue::printPretty(raw_ostream &Out, const PrintingPolicy &Policy, case APValue::Indeterminate: Out << ""; return; - case APValue::Int: + case APValue::Int: { +const APSInt &Val = getInt(); +if (const EnumType *ET = Ty->getAs())

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
https://github.com/sethp edited https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-10 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/8] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to 'A{0, {0, 3, 4}, 5} == A{1, {2, 3, 4}, 5}'}} +static_assert

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread via cfe-commits
sethp wrote: In playing around with this some more, I found it was pretty effective for me to have an intializer-like expression (as in [e769f15](https://github.com/llvm/llvm-project/pull/74852/commits/e769f158c8ee001e95299ce4c83e5250e2a8f963) ), because then I could copy/paste the output from

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-09 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/7] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-08 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/6] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-08 Thread Erich Keane via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-06 Thread Craig Topper via cfe-commits
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/4] [Clang][Sema] Print more static_assert exprs This change in

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-06 Thread via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -std=c++2a -verify %s + +struct A { + int a, b[3], c; + bool operator==(const A&) const = default; +}; + +constexpr auto a0 = A{0, 0, 3, 4, 5}; + +// expected-note@+1 {{evaluates to '{0, {0, 3, 4}, 5} == {1, {2, 3, 4}, 5}'}} +static_assert(a

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/3] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread Erich Keane via cfe-commits
@@ -6,20 +6,20 @@ struct A { }; static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5}); -static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread via cfe-commits
@@ -6,20 +6,20 @@ struct A { }; static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5}); -static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread via cfe-commits
https://github.com/sethp updated https://github.com/llvm/llvm-project/pull/74852 >From f281d34a51f662c934f158e4770774b0dc3588a2 Mon Sep 17 00:00:00 2001 From: Seth Pellegrino Date: Thu, 7 Dec 2023 08:45:51 -0800 Subject: [PATCH 1/2] [Clang][Sema] Print more static_assert exprs This change intro

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-05 Thread via cfe-commits
@@ -6,20 +6,20 @@ struct A { }; static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5}); -static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-03 Thread Erich Keane via cfe-commits
@@ -6,20 +6,20 @@ struct A { }; static_assert(A{1, 2, 3, 4, 5} == A{1, 2, 3, 4, 5}); -static_assert(A{1, 2, 3, 4, 5} == A{0, 2, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3, 4, 5} == A{1, 0, 3, 4, 5}); // expected-error {{failed}} -static_assert(A{1, 2, 3

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I too would like to see some more complicated dumps for 'complicated' structs (inheritance, multiple inheritance, etc), and vectors/arrays of complicated structs. I am really concerned with the 'depth' that this will show and be unwieldy as a result.

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-01-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-18 Thread via cfe-commits
sethp wrote: Thanks for the feedback! I've definitely found it helpful trying to puzzle out why one of my static_asserts is failing, though it's certainly a far less complete solution than the document @tahonermann shared. The output from `printPretty` will definitely fall apart for a complex

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: I like this change, the only thing I'm a little afraid of is that the output will deteriorate for large structs https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-12 Thread Tom Honermann via cfe-commits
tahonermann wrote: This looks like a good change to me since coercing a compiler to reveal the values of compile-time objects can be frustrating. We could really use something like `constexpr_print` from [P2758 (Emitting messages at compile time)](https://wg21.link/p2758). https://github.com/

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I don't feel like the changes are an improvement to the diagnostic but I would like to hear from others who focus on clang front-end reviews. https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (sethp) Changes This change introspects more values involved in a static_assert, and extends the supported set of operators for introspection to include binary operator method calls. It's intended to address the use-case where a sma

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-08 Thread via cfe-commits
https://github.com/sethp created https://github.com/llvm/llvm-project/pull/74852 This change introspects more values involved in a static_assert, and extends the supported set of operators for introspection to include binary operator method calls. It's intended to address the use-case where a