Re: [PATCH] c++: folding non-dep enumerator from current inst [PR115139]

2024-05-17 Thread Marek Polacek
On Fri, May 17, 2024 at 12:05:15PM -0400, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for > trunk/14? This patch looks good to me, thanks. > -- >8 -- > > After the tsubst_copy removal r14-4796-g3e3d73ed5e85e7 GCC 14 ICEs during >

[gcc r15-523] c++: ICE with reference NSDMI [PR114854]

2024-05-15 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:1a05332bbac98a4c002bef3fb45a3ad9d56b3a71 commit r15-523-g1a05332bbac98a4c002bef3fb45a3ad9d56b3a71 Author: Marek Polacek Date: Wed May 8 15:43:58 2024 -0400 c++: ICE with reference NSDMI [PR114854] Here we crash on a cp_gimplify_expr/TARGET_EXPR assert

[gcc r15-522] c++: DR 569, DR 1693: fun with semicolons [PR113760]

2024-05-15 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:0b3eac4b54a52bf206b88743d1e987badc97cff4 commit r15-522-g0b3eac4b54a52bf206b88743d1e987badc97cff4 Author: Marek Polacek Date: Mon Feb 12 19:36:16 2024 -0500 c++: DR 569, DR 1693: fun with semicolons [PR113760] Prompted by c++/113760, I started looking

[gcc r15-515] c++: add test for DR 2855

2024-05-15 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:3cefe91b74f65f0db71472e01ca83c69e2cd81cc commit r15-515-g3cefe91b74f65f0db71472e01ca83c69e2cd81cc Author: Marek Polacek Date: Tue May 14 13:48:30 2024 -0400 c++: add test for DR 2855 Let int8_t x = 127; This DR says that while

[PATCH] c++: add test for DR 2855

2024-05-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, OK to add such a test? -- >8 -- Let int8_t x = 127; This DR says that while x++; invokes UB, ++x; does not. The resolution was to make the first one valid. The following test verifies that we don't report any errors in a constexpr context. DR

[PATCH v2] c++: DR 569, DR 1693: fun with semicolons [PR113760]

2024-05-14 Thread Marek Polacek
On Thu, May 09, 2024 at 12:44:52PM -0400, Jason Merrill wrote: > On 5/9/24 12:16, Marek Polacek wrote: > > +static void > > +maybe_warn_extra_semi (location_t loc, extra_semi_kind kind) > > +{ > > + /* -Wno-extra-semi suppresses all. */ > > + if (warn

gcc-wwwdocs branch master updated. ed2a7a47d4814413db7ac79068d7938c03ad639f

2024-05-14 Thread Marek Polacek via Gcc-cvs-wwwdocs
--- commit ed2a7a47d4814413db7ac79068d7938c03ad639f Author: Marek Polacek Date: Tue May 14 11:21:10 2024 -0400 cxx-dr-status.html: Add PR for CWG1521 diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index e29d2407..3eaef497 100644 --- a/htdocs/projects/cxx-dr-status.html +++ b/htdoc

[PATCH v2] c++: ICE with reference NSDMI [PR114854]

2024-05-14 Thread Marek Polacek
On Thu, May 09, 2024 at 03:47:54PM -0400, Jason Merrill wrote: > On 5/9/24 12:04, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we crash on a cp_gimplify_expr/TARGET_EXPR assert: > > > &

[wwwdocs] cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 114

2024-05-13 Thread Marek Polacek
Pushed. commit 06c46c88cc02e0dff5f65b41754178fb25fb939e Author: Marek Polacek Date: Mon May 13 16:09:05 2024 -0400 cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 114 diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index a5f45359

gcc-wwwdocs branch master updated. 9bf29b467ec2e5a40a2caa2dfba936be8ffa99b3

2024-05-13 Thread Marek Polacek via Gcc-cvs-wwwdocs
ow. - Log - commit 9bf29b467ec2e5a40a2caa2dfba936be8ffa99b3 Author: Marek Polacek Date: Mon May 13 16:12:13 2024 -0400 cxx-dr-status: Update CWG1228 diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index 2a61cfbd..c70cd

Re: [PATCH] c++: Avoid using __array_rank as a variable name [PR115061]

2024-05-13 Thread Marek Polacek
On Sun, May 12, 2024 at 11:48:07PM -0700, Ken Matsui wrote: > This patch fixes a compilation error when building GCC using Clang. > Since __array_rank is used as a built-in trait name, use rank instead. I think you can go ahead and push this patch as obvious, thanks. > PR c++/115061 > >

[gcc r15-351] c++: failure to suppress -Wsizeof-array-div in template [PR114983]

2024-05-09 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:646db3d30bd071a1b671b4f91c9ea2ab7f2be21c commit r15-351-g646db3d30bd071a1b671b4f91c9ea2ab7f2be21c Author: Marek Polacek Date: Wed May 8 17:02:49 2024 -0400 c++: failure to suppress -Wsizeof-array-div in template [PR114983] -Wsizeof-array-div offers a way

[PATCH v2] c++: failure to suppress -Wsizeof-array-div in template [PR114983]

2024-05-09 Thread Marek Polacek
On Thu, May 09, 2024 at 12:51:28PM -0400, Jason Merrill wrote: > On 5/9/24 12:03, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > -Wsizeof-array-div offers a way to suppress the warning by wrapping > >

Re: [PATCH] c++: Optimize in maybe_clone_body aliases even when not at_eof [PR113208]

2024-05-09 Thread Marek Polacek
On Thu, May 09, 2024 at 08:20:00PM +0200, Jakub Jelinek wrote: > --- gcc/cp/decl.cc.jj 2024-05-09 10:30:54.804505130 +0200 > +++ gcc/cp/decl.cc2024-05-09 17:07:08.400110018 +0200 > @@ -19280,6 +19280,14 @@ cxx_comdat_group (tree decl) > else > break; > } > + /* If

[gcc r15-348] c++: lambda capturing structured bindings [PR85889]

2024-05-09 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:46bafd9a6b9b776142e0b1424a6ac02e3a2fd300 commit r15-348-g46bafd9a6b9b776142e0b1424a6ac02e3a2fd300 Author: Marek Polacek Date: Fri Mar 1 17:13:02 2024 -0500 c++: lambda capturing structured bindings [PR85889] <https://wg21.link/p1381r1> clarifies that i

[PATCH] c++: DR 569, DR 1693: fun with semicolons [PR113760]

2024-05-09 Thread Marek Polacek
In GCC 14, I submitted a minimal fix for the "extra ; warning", pushed in r14-8967. That patch mentions a more complete patch for GCC 15. This is the patch. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Prompted by c++/113760, I started looking into a bogus "extra ;"

[PATCH] c++: ICE with reference NSDMI [PR114854]

2024-05-09 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we crash on a cp_gimplify_expr/TARGET_EXPR assert: /* A TARGET_EXPR that expresses direct-initialization should have been elided by cp_gimplify_init_expr. */ gcc_checking_assert

[PATCH] c++: failure to suppress -Wsizeof-array-div in template [PR114983]

2024-05-09 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- -Wsizeof-array-div offers a way to suppress the warning by wrapping the second operand of the division in parens: sizeof (samplesBuffer) / (sizeof(unsigned char)) but this doesn't work in a template, because we fail to

[gcc r15-329] c++: #pragma doesn't disable -Wunused-label [PR113582]

2024-05-08 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:d9318caed3bbff8136d13e00dcfc020a59d10f78 commit r15-329-gd9318caed3bbff8136d13e00dcfc020a59d10f78 Author: Marek Polacek Date: Wed Jan 24 18:06:48 2024 -0500 c++: #pragma doesn't disable -Wunused-label [PR113582] The PR complains that void

[gcc r15-301] c++: DECL_DECOMPOSITION_P cleanup

2024-05-07 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:7887d808876c00e682e11c19caae1a0dbc9fa3a8 commit r15-301-g7887d808876c00e682e11c19caae1a0dbc9fa3a8 Author: Marek Polacek Date: Fri Mar 1 13:36:51 2024 -0500 c++: DECL_DECOMPOSITION_P cleanup DECL_DECOMPOSITION_P already checks VAR_P but we repeat the check

ping [PATCH] contrib: add cxx-dr-table.sh

2024-05-06 Thread Marek Polacek
A patch to to keep up-to-date: Marek

Re: [PATCH] c++: ICE with templated sizeof(E1) / sizeof(E2) [PR114888]

2024-04-29 Thread Marek Polacek
On Mon, Apr 29, 2024 at 10:28:19AM -0400, Patrick Palka wrote: > Lightly tested on x86_64-pc-linux-gnu so far, does this look OK for > trunk/14.1 after bootstrap+regtest finishes? LGTM. > -- >8 -- > > We're missing a dependence check for the second operand in the > sizeof / sizeof handling. >

Re: [COMMITTED] gcc-14: Add Ada changes

2024-04-26 Thread Marek Polacek
On Fri, Apr 26, 2024 at 10:55:35AM +0200, Marc Poulhiès wrote: > Co-authored-by: Fernando Oleo Blanco > Co-authored-by: Piotr Trojanek > Signed-off-by: Marc Poulhiès > --- > htdocs/gcc-14/changes.html | 67 +- > 1 file changed, 66 insertions(+), 1

Re: [PATCH] wwwdocs: Add note to changes.html for __has_{feature,extension}

2024-04-26 Thread Marek Polacek
On Fri, Apr 26, 2024 at 11:12:54AM +0100, Alex Coplan wrote: > On 17/04/2024 11:41, Marek Polacek wrote: > > On Mon, Apr 15, 2024 at 11:13:27AM +0100, Alex Coplan wrote: > > > On 04/04/2024 11:00, Alex Coplan wrote: > > > > Hi, > > > > > >

[gcc r14-10075] testsuite: prune -freport-bug output

2024-04-22 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:0db19228a9feba5a8f4e13b21f25f3aa8a6c5e85 commit r14-10075-g0db19228a9feba5a8f4e13b21f25f3aa8a6c5e85 Author: Marek Polacek Date: Fri Apr 19 13:51:41 2024 -0400 testsuite: prune -freport-bug output When the compiler defaults to -freport-bug, a few dg-ice tests

[PATCH] testsuite: prune -freport-bug output

2024-04-19 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I can defer to 15 if needed, of course. -- >8 -- When the compiler defaults to -freport-bug, a few dg-ice tests fail with: Excess errors: Preprocessed source stored into /tmp/cc6hldZ0.out file, please attach this to your bugreport.

Re: [PATCH] wwwdocs: Add note to changes.html for __has_{feature,extension}

2024-04-17 Thread Marek Polacek
On Mon, Apr 15, 2024 at 11:13:27AM +0100, Alex Coplan wrote: > On 04/04/2024 11:00, Alex Coplan wrote: > > Hi, > > > > This adds a note to the GCC 14 release notes mentioning support for > > __has_{feature,extension} (PR60512). > > > > OK to commit? > > Ping. Is this changes.html patch OK? I

[gcc r14-9950] c++: ICE with temporary of class type in array DMI [PR109966]

2024-04-12 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:6039925631780741ba77666ef2ef743aa2a925a8 commit r14-9950-g6039925631780741ba77666ef2ef743aa2a925a8 Author: Marek Polacek Date: Mon Mar 11 17:45:55 2024 -0400 c++: ICE with temporary of class type in array DMI [PR109966] This ICE started with the fairly

gcc-wwwdocs branch master updated. d18a80a52a7ec2edd7ef9a583d8920d61c0b48e5

2024-04-12 Thread Marek Polacek via Gcc-cvs-wwwdocs
--- commit d18a80a52a7ec2edd7ef9a583d8920d61c0b48e5 Author: Marek Polacek Date: Fri Apr 12 18:02:35 2024 -0400 cxx-dr-status: Update CWG 1996 diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index 24c54cfd..a5f45359 100644 --- a/htdocs/projects/cxx-dr-status.html +++ b/htdocs/proje

Re: [PATCH v3] c++: ICE with temporary of class type in array DMI [PR109966]

2024-04-12 Thread Marek Polacek
On Fri, Apr 12, 2024 at 04:15:45PM -0400, Jason Merrill wrote: > On 3/14/24 17:26, Marek Polacek wrote: > > > > In the following patch, I'm taking a different tack. I believe > > we ought to use TARGET_EXPR_ELIDING_P. The gimplify_arg bit I'm &g

gcc-wwwdocs branch master updated. 3ca51fec661f3340fe308662405e602bcf3fe8d7

2024-04-12 Thread Marek Polacek via Gcc-cvs-wwwdocs
--- commit 3ca51fec661f3340fe308662405e602bcf3fe8d7 Author: Marek Polacek Date: Fri Apr 12 14:36:44 2024 -0400 cxx-dr-status: Minor update diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index fb3046cd..24c54cfd 100644 --- a/htdocs/projects/cxx-dr-status.html +++ b/htdocs/proje

[wwwdocs] Update cxx-dr-status page

2024-04-11 Thread Marek Polacek
A big update. I posted a script to generate new entries and check the existing separately. W3 validated. Pushed. commit 9e32f911b70a8c2303b9b60679ce337896ccffdd Author: Marek Polacek Date: Thu Apr 11 21:18:23 2024 -0400 cxx-dr-status: Update from C++ Core Language Issue TOC, Revision

[PATCH] contrib: add cxx-dr-table.sh

2024-04-11 Thread Marek Polacek
Use --check to check if the existing entries need to be updated. +# May need $ iconv -f iso-8859-1 -t utf-8 cwg_toc.html > cwg_toc2.html + +# Written by Marek Polacek + +AWK=/usr/bin/awk +DIFF=/usr/bin/vimdiff +SED=/usr/bin/sed + +usage() +{ + echo "Usage: $0 --check cwg_toc.html ~/src/gc

gcc-wwwdocs branch master updated. 9e32f911b70a8c2303b9b60679ce337896ccffdd

2024-04-11 Thread Marek Polacek via Gcc-cvs-wwwdocs
--- commit 9e32f911b70a8c2303b9b60679ce337896ccffdd Author: Marek Polacek Date: Thu Apr 11 21:18:23 2024 -0400 cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 113 diff --git a/htdocs/projects/cxx-dr-status.html b/htdocs/projects/cxx-dr-status.html index b63c47df..fb3046cd 100644 --- a/htdocs/proje

[gcc r14-9903] target: missing -Whardened with -fcf-protection=none [PR114606]

2024-04-10 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:b8b148bc22673689fda19711b428b544462be2e4 commit r14-9903-gb8b148bc22673689fda19711b428b544462be2e4 Author: Marek Polacek Date: Fri Apr 5 12:37:19 2024 -0400 target: missing -Whardened with -fcf-protection=none [PR114606] -Whardened warns when -fhardened

[wwwdocs] Document more C++ changes

2024-04-10 Thread Marek Polacek
I went through all cp/ commits in GCC 14 and documented a few interesting user-visible changes, modulo Modules. W3 validated. Pushed. commit d65752191baaa137eb6d604b802e7b9170a39752 Author: Marek Polacek Date: Wed Apr 10 17:21:09 2024 -0400 gcc-14/changes: Document more C++ changes

gcc-wwwdocs branch master updated. d65752191baaa137eb6d604b802e7b9170a39752

2024-04-10 Thread Marek Polacek via Gcc-cvs-wwwdocs
--- commit d65752191baaa137eb6d604b802e7b9170a39752 Author: Marek Polacek Date: Wed Apr 10 17:21:09 2024 -0400 gcc-14/changes: Document more C++ changes diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 4a063346..5c2439ab 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html

Re: [PATCH] c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]

2024-04-05 Thread Marek Polacek
On Fri, Apr 05, 2024 at 09:40:48AM +0200, Jakub Jelinek wrote: > Hi! > > When looking at maybe_warn_for_constant_evaluated for the trivial > infinite loops patch, I've noticed that it can emit weird diagnostics > for if constexpr in templates, first warn that std::is_constant_evaluted() > always

[PATCH v2] target: missing -Whardened with -fcf-protection=none [PR114606]

2024-04-05 Thread Marek Polacek
On Fri, Apr 05, 2024 at 08:28:08PM +0200, Jakub Jelinek wrote: > On Fri, Apr 05, 2024 at 02:22:18PM -0400, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > -Whardened warns when -fhardened couldn't enable

[PATCH] target: missing -Whardened with -fcf-protection=none [PR114606]

2024-04-05 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- -Whardened warns when -fhardened couldn't enable a hardening option because that option was disabled on the command line, e.g.: $ ./cc1plus -quiet g.C -fhardened -O2 -fstack-protector cc1plus: warning:

[gcc r14-9815] c++: add fixed test [PR91079]

2024-04-05 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:2b2d3a135a43cbafadd8957e0b2543f38c390437 commit r14-9815-g2b2d3a135a43cbafadd8957e0b2543f38c390437 Author: Marek Polacek Date: Fri Apr 5 13:40:33 2024 -0400 c++: add fixed test [PR91079] Fixed by r12-2975. PR c++/91079 DR 1881

[pushed] c++: add fixed test [PR91079]

2024-04-05 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r12-2975. PR c++/91079 DR 1881 gcc/testsuite/ChangeLog: * g++.dg/ext/is_std_layout5.C: New test. --- gcc/testsuite/g++.dg/ext/is_std_layout5.C | 13 + 1 file changed, 13 insertions(+) create

[pushed] c-family: remove dead #undef

2024-04-05 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- The #undef was added in r0-90320-g100d537d7a7b5c but it never did anything. gcc/c-family/ChangeLog: * c-warn.cc (warn_about_parentheses): Remove an #undef. --- gcc/c-family/c-warn.cc | 1 - 1 file changed, 1 deletion(-) diff

[gcc r14-9810] c-family: remove dead #undef

2024-04-05 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:e4d074321bcafa6504ee6b77754b4450a4622f9d commit r14-9810-ge4d074321bcafa6504ee6b77754b4450a4622f9d Author: Marek Polacek Date: Thu Apr 4 19:28:00 2024 -0400 c-family: remove dead #undef The #undef was added in r0-90320-g100d537d7a7b5c but it never did

[gcc r14-9809] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-05 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:8c9063825ce726fcbbc067d8a6d062cc2d4acf5e commit r14-9809-g8c9063825ce726fcbbc067d8a6d062cc2d4acf5e Author: Marek Polacek Date: Tue Apr 2 12:59:38 2024 -0400 c++: constexpr error with fn redecl in local scope [PR32] We evaluate constexpr functions

[PATCH v2] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-04 Thread Marek Polacek
On Thu, Apr 04, 2024 at 05:28:22PM -0400, Jason Merrill wrote: > On 4/4/24 14:43, Marek Polacek wrote: > > On Wed, Apr 03, 2024 at 01:14:46PM -0400, Jason Merrill wrote: > > > On 4/2/24 13:52, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64

Re: [PATCH] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-04 Thread Marek Polacek
On Wed, Apr 03, 2024 at 01:14:46PM -0400, Jason Merrill wrote: > On 4/2/24 13:52, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? > > > > -- >8 -- > > We evaluate constexpr functions on the original, pre-generic

[gcc r14-9759] c++: make __is_array return false for T[0] [PR114479]

2024-04-02 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:2f2924078ce51c2a0da3ad8f958f2d1de533969a commit r14-9759-g2f2924078ce51c2a0da3ad8f958f2d1de533969a Author: Marek Polacek Date: Mon Apr 1 12:55:46 2024 -0400 c++: make __is_array return false for T[0] [PR114479] When we switched to using the __is_array built

[gcc r13-8560] c++: ICE with scoped enum in switch condition [PR103825]

2024-04-02 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:22510e4a68aa9ca850db34ae62c21c58442d8ab3 commit r13-8560-g22510e4a68aa9ca850db34ae62c21c58442d8ab3 Author: Marek Polacek Date: Fri Mar 29 16:59:37 2024 -0400 c++: ICE with scoped enum in switch condition [PR103825] Here we ICE when gimplifying

[gcc r14-9758] c++: ICE with scoped enum in switch condition [PR103825]

2024-04-02 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:daa2e7c7ffe49b788357f7f2c9ef1c9b125c1f8c commit r14-9758-gdaa2e7c7ffe49b788357f7f2c9ef1c9b125c1f8c Author: Marek Polacek Date: Fri Mar 29 16:59:37 2024 -0400 c++: ICE with scoped enum in switch condition [PR103825] Here we ICE when gimplifying

[PATCH] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-02 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- We evaluate constexpr functions on the original, pre-genericization bodies. That means that the function body we're evaluating will not have gone through cp_genericize_r's "Map block scope extern declarations to visible

[PATCH] c++: make __is_array return false for T[0] [PR114479]

2024-04-01 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- When we switched to using the __is_array built-in trait to implement std::is_array in r14-6623-g7fd9c349e45534, we started saying that T[0] is an array. There are various opinions as to whether that is the best answer, but it

[PATCH] c++: ICE with scoped enum in switch condition [PR114451]

2024-03-29 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- Here we ICE when gimplifying enum class Type { Pawn }; struct Piece { Type type : 4; }; void foo() { switch (Piece().type) case Type::Pawn:; } because we ended up with TYPE_PRECISION (cond) <

[pushed] c++: add fixed test [PR100557]

2024-03-26 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- We used to hit the "Error reporting routines re-entered." ICE here but it was fixed by Patrick's r14-3809. PR c++/100557 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr100557.C: New test. ---

[gcc r14-9674] c++: add fixed test [PR100557]

2024-03-26 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:c0e199e4dbe652cd16d7248f0bfe166540f5d95b commit r14-9674-gc0e199e4dbe652cd16d7248f0bfe166540f5d95b Author: Marek Polacek Date: Tue Mar 26 10:39:48 2024 -0400 c++: add fixed test [PR100557] We used to hit the "Error reporting routines re-entered."

[gcc r14-9659] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-25 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:8651991fe2ea90a7276e91673b15b5c3865f14d7 commit r14-9659-g8651991fe2ea90a7276e91673b15b5c3865f14d7 Author: Marek Polacek Date: Fri Mar 15 09:23:28 2024 -0400 c++: ICE with noexcept and local specialization, again [PR114349] Patrick noticed that my r14-9339

[gcc r14-9658] c++: broken direct-init with trailing array member [PR114439]

2024-03-25 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:de0886d48032332d10e4acb5d15c8789b281b6fe commit r14-9658-gde0886d48032332d10e4acb5d15c8789b281b6fe Author: Marek Polacek Date: Mon Mar 25 15:32:20 2024 -0400 c++: broken direct-init with trailing array member [PR114439] can_init_array_with_p is wrongly

[PATCH v3] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-25 Thread Marek Polacek
On Mon, Mar 25, 2024 at 03:40:10PM -0400, Jason Merrill wrote: > On 3/22/24 17:30, Marek Polacek wrote: > > On Thu, Mar 21, 2024 at 05:27:37PM -0400, Jason Merrill wrote: > > > On 3/21/24 17:01, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

[PATCH] c++: broken direct-init with trailing array member [PR114439]

2024-03-25 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- can_init_array_with_p is wrongly saying that the init for 's' here: struct S { int *list = arr; int arr[]; }; struct A { A() {} S s[2]{}; }; is invalid. But as process_init_constructor_array says,

Re: [PATCH v2] c++: direct-init of an array of class type [PR59465]

2024-03-25 Thread Marek Polacek
On Mon, Mar 25, 2024 at 01:39:39PM +0100, Stephan Bergmann wrote: > On 3/25/24 13:07, Jakub Jelinek wrote: > > On Mon, Mar 25, 2024 at 12:36:46PM +0100, Stephan Bergmann wrote: > > > This started to break > > > > > > > $ cat test.cc > > > > struct S1 { S1(); }; > > > > struct S2 { > > > >

[PATCH v2] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-22 Thread Marek Polacek
On Thu, Mar 21, 2024 at 05:27:37PM -0400, Jason Merrill wrote: > On 3/21/24 17:01, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Patrick noticed that my r14-9339-gdc6c3bfb59baab patch is wrong; > >

[gcc r14-9622] c++: direct-init of an array of class type [PR59465]

2024-03-22 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:d1d8fd2884b44598d80de1038b086eec41519d4b commit r14-9622-gd1d8fd2884b44598d80de1038b086eec41519d4b Author: Marek Polacek Date: Thu Feb 22 18:49:08 2024 -0500 c++: direct-init of an array of class type [PR59465] ...from another array in a mem-initializer

Re: [PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-21 Thread Marek Polacek
On Fri, Mar 15, 2024 at 12:12:49PM -0400, Patrick Palka wrote: > On Fri, 15 Mar 2024, Marek Polacek wrote: > > > On Fri, Mar 15, 2024 at 10:35:07AM -0400, Patrick Palka wrote: > > > On Tue, 5 Mar 2024, Marek Polacek wrote: > > > > > > > Bootstrapped/regt

[PATCH] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-21 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Patrick noticed that my r14-9339-gdc6c3bfb59baab patch is wrong; we're dealing with a noexcept-spec there, not a noexcept-expr, so setting cp_noexcept_operand et al is incorrect. Back to the drawing board then. To fix

[PATCH v2] c++: direct-init of an array of class type [PR59465]

2024-03-21 Thread Marek Polacek
On Wed, Mar 20, 2024 at 09:21:02PM -0400, Jason Merrill wrote: > On 3/1/24 19:58, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I don't > > claim that this has to go to 14 though. > > > > -- >8 -- > > ...from anoth

[gcc r14-9596] c++: explicit inst of template method not generated [PR110323]

2024-03-21 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:081f8937cb82da311c224da04b0c6cbd57a8fb5d commit r14-9596-g081f8937cb82da311c224da04b0c6cbd57a8fb5d Author: Marek Polacek Date: Thu Mar 7 20:41:23 2024 -0500 c++: explicit inst of template method not generated [PR110323] Consider constexpr int VAL

[gcc r14-9558] testsuite: fix target for linkage-1.C

2024-03-19 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:7a6261332de58fd47283d694d8cd61ea7cdb324c commit r14-9558-g7a6261332de58fd47283d694d8cd61ea7cdb324c Author: Marek Polacek Date: Tue Mar 19 17:15:38 2024 -0400 testsuite: fix target for linkage-1.C This test fails in C++11 due to: linkage-1.C:3:8

[pushed] testsuite: fix target for linkage-1.C

2024-03-19 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- This test fails in C++11 due to: linkage-1.C:3:8: error: 'f' function uses 'auto' type specifier without trailing return type 3 | inline auto f() { |^~~~ linkage-1.C:3:8: note: deduced return type only available with

Re: [PATCH] c++: direct-init of an array of class type [PR59465]

2024-03-19 Thread Marek Polacek
Ping. Though I reckon it may be better to defer this to 15. On Fri, Mar 01, 2024 at 07:58:51PM -0500, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I don't > claim that this has to go to 14 though. > > -- >8 -- > ...from another array in

Re: [PATCH v3] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-19 Thread Marek Polacek
On Thu, Mar 14, 2024 at 05:26:59PM -0400, Marek Polacek wrote: > @@ -1441,11 +1406,13 @@ static tree > replace_placeholders_for_class_temp_r (tree *tp, int *, void *data) > { >tree t = *tp; > - tree full_expr = *static_cast(data); > + auto pset = static_cast *>(dat

[PATCH v2] c++: explicit inst of template method not generated [PR110323]

2024-03-19 Thread Marek Polacek
On Mon, Mar 18, 2024 at 09:10:27PM -0400, Jason Merrill wrote: > On 3/15/24 13:48, Marek Polacek wrote: > > On Thu, Mar 14, 2024 at 03:39:04PM -0400, Jason Merrill wrote: > > > On 3/8/24 12:02, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

Re: [PATCH] c++: explicit inst of template method not generated [PR110323]

2024-03-15 Thread Marek Polacek
On Thu, Mar 14, 2024 at 03:39:04PM -0400, Jason Merrill wrote: > On 3/8/24 12:02, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Consider > > > >constexpr int VAL = 1; > >struc

Re: [PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-15 Thread Marek Polacek
On Fri, Mar 15, 2024 at 10:35:07AM -0400, Patrick Palka wrote: > On Tue, 5 Mar 2024, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we ICE because we call register_local_specialization while >

[PATCH v3] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-14 Thread Marek Polacek
On Tue, Mar 12, 2024 at 06:26:14PM -0400, Jason Merrill wrote: > On 3/12/24 11:56, Marek Polacek wrote: > > On Tue, Mar 12, 2024 at 09:57:14AM -0400, Jason Merrill wrote: > > > On 3/11/24 19:27, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64

[PATCH v2] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-12 Thread Marek Polacek
On Tue, Mar 12, 2024 at 09:57:14AM -0400, Jason Merrill wrote: > On 3/11/24 19:27, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? > > > > -- >8 -- > > This ICE started with the fairly complicated r13-765. We crash in > &g

[PATCH] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-11 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- This ICE started with the fairly complicated r13-765. We crash in gimplify_var_or_parm_decl because a stray VAR_DECL leaked there. The problem is ultimately that potential_prvalue_result_of wasn't correctly handling arrays

[PATCH] c++: explicit inst of template method not generated [PR110323]

2024-03-08 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Consider constexpr int VAL = 1; struct foo { template void bar(typename std::conditional::type arg) { } }; template void foo::bar<1>(int arg); where we since r11-291 fail to emit the code for the explicit

[gcc r14-9364] c++: ICE with variable template and [[deprecated]] [PR110031]

2024-03-07 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:9f915684624413f96e1a5ffada398ccd1c533e38 commit r14-9364-g9f915684624413f96e1a5ffada398ccd1c533e38 Author: Marek Polacek Date: Mon Mar 4 12:35:18 2024 -0500 c++: ICE with variable template and [[deprecated]] [PR110031] lookup_and_finish_template_variable

[gcc r14-9339] c++: ICE with noexcept and local specialization [PR114114]

2024-03-06 Thread Marek Polacek via Gcc-cvs
https://gcc.gnu.org/g:dc6c3bfb59baab28b998e18396c06087b6d9b0ed commit r14-9339-gdc6c3bfb59baab28b998e18396c06087b6d9b0ed Author: Marek Polacek Date: Tue Mar 5 13:33:10 2024 -0500 c++: ICE with noexcept and local specialization [PR114114] Here we ICE because we call

[PATCH] c++: ICE with noexcept and local specialization [PR114114]

2024-03-05 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we ICE because we call register_local_specialization while local_specializations is null, so local_specializations->put (); crashes on null this. It's null since maybe_instantiate_noexcept calls push_to_top_level

[PATCH] c++: ICE with variable template and [[deprecated]] [PR110031]

2024-03-04 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- lookup_and_finish_template_variable already has and uses the complain parameter but it is not passing it down to mark_used so we got the default tf_warning_or_error, which causes various problems when

Re: [PATCH] c++: lambda capturing structured bindings [PR85889]

2024-03-04 Thread Marek Polacek
On Fri, Mar 01, 2024 at 07:58:24PM -0500, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for 15? (Or even trunk?) > > -- >8 -- > <https://wg21.link/p1381r1> clarifies that it's OK to capture structured > bindings. > > [expr.prim.lambda.c

Re: [PATCH v5] c++: implement [[gnu::non_owning]] [PR110358]

2024-03-04 Thread Marek Polacek
On Mon, Mar 04, 2024 at 11:00:18AM +, Jonathan Wakely wrote: > On 01/03/24 15:38 -0500, Jason Merrill wrote: > > On 3/1/24 14:24, Marek Polacek wrote: > > > +@smallexample > > > +template > > > +[[gnu::no_dangling(std::is_reference_v)]] int foo (T& t)

[PATCH] c++: DECL_DECOMPOSITION_P cleanup

2024-03-01 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for 15? -- >8 -- DECL_DECOMPOSITION_P already checks VAR_P but we repeat the check in a lot of places. gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Don't check VAR_P before DECL_DECOMPOSITION_P. * init.cc

[PATCH] c++: direct-init of an array of class type [PR59465]

2024-03-01 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I don't claim that this has to go to 14 though. -- >8 -- ...from another array in a mem-initializer should not be accepted. We already reject struct string {} a[1]; string x[1](a); but struct pair { string s[1];

[PATCH] c++: lambda capturing structured bindings [PR85889]

2024-03-01 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for 15? (Or even trunk?) -- >8 -- clarifies that it's OK to capture structured bindings. [expr.prim.lambda.capture]/4 says "The identifier in a simple-capture shall denote a local entity" and [basic.pre]/3: "An entity

[PATCH v5] c++: implement [[gnu::non_owning]] [PR110358]

2024-03-01 Thread Marek Polacek
On Fri, Mar 01, 2024 at 01:19:40PM -0500, Jason Merrill wrote: > On 3/1/24 12:39, Marek Polacek wrote: > > @option{-Wdangling-reference} also warns about code like > > @smallexample > > @@ -3932,6 +3935,10 @@ struct Span @{ > > as @code{std::span}-like; that i

[PATCH v4] c++: implement [[gnu::non_owning]] [PR110358]

2024-03-01 Thread Marek Polacek
On Thu, Feb 29, 2024 at 07:30:02PM -0500, Jason Merrill wrote: > On 2/29/24 19:12, Marek Polacek wrote: > > On Wed, Feb 28, 2024 at 06:03:54PM -0500, Jason Merrill wrote: > > > > > Hmm, if we're also going to allow the attribute to be applied to a > > > functio

[PATCH v3] c++: implement [[gnu::non_owning]] [PR110358]

2024-02-29 Thread Marek Polacek
On Wed, Feb 28, 2024 at 06:03:54PM -0500, Jason Merrill wrote: > On 2/21/24 19:35, Marek Polacek wrote: > > On Fri, Jan 26, 2024 at 04:04:35PM -0500, Jason Merrill wrote: > > > On 1/25/24 20:37, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

Re: [pushed] testsuite: fix Wmismatched-new-delete-8.C with -m32

2024-02-22 Thread Marek Polacek
On Thu, Feb 22, 2024 at 04:06:51PM -0800, Andrew Pinski wrote: > On Thu, Feb 22, 2024, 15:56 Marek Polacek wrote: > > > Tested x86_64-pc-linux-gnu, applying to trunk. > > > I backported/pushed the change to 13 branch already so please apply it > there too. Ah right. Done. Marek

[pushed] testsuite: fix Wmismatched-new-delete-8.C with -m32

2024-02-22 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- This fixes error: 'operator new' takes type 'size_t' ('unsigned int') as first parameter [-fpermissive] gcc/testsuite/ChangeLog: * g++.dg/warn/Wmismatched-new-delete-8.C: Use __SIZE_TYPE__. ---

Re: [PATCH] c++: -Wuninitialized when binding a ref to uninit DM [PR113987]

2024-02-22 Thread Marek Polacek
On Thu, Feb 22, 2024 at 08:34:45AM +, Jason Merrill wrote: > On 2/20/24 19:15, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > This PR asks that our -Wuninitialized for mem-initializers does > &g

[PATCH v2] c++: implement [[gnu::non_owning]] [PR110358]

2024-02-21 Thread Marek Polacek
On Fri, Jan 26, 2024 at 04:04:35PM -0500, Jason Merrill wrote: > On 1/25/24 20:37, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Since -Wdangling-reference has false positives that can't be > > pr

[PATCH] c++: -Wuninitialized when binding a ref to uninit DM [PR113987]

2024-02-20 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This PR asks that our -Wuninitialized for mem-initializers does not warn when binding a reference to an uninitialized data member. We already check !INDIRECT_TYPE_P in find_uninit_fields_r, but that won't catch binding a

[PATCH v3] c++: wrong looser excep spec for dep noexcept [PR113158]

2024-02-16 Thread Marek Polacek
On Fri, Feb 16, 2024 at 04:39:47PM -0500, Patrick Palka wrote: > On Fri, 16 Feb 2024, Marek Polacek wrote: > > + /* We also have to defer checking when we're in a template and couldn't > > + instantiate & evaluate the noexcept to true/false. */ > > + if

[PATCH v2] c++: wrong looser excep spec for dep noexcept [PR113158]

2024-02-16 Thread Marek Polacek
On Fri, Feb 16, 2024 at 03:58:02PM -0500, Jason Merrill wrote: > On 2/15/24 17:17, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > By the ??? below I mean that maybe_instantiate_noexcept could

Re: [COMMITTED] c++: Add testcase for this PR [PR97990]

2024-02-16 Thread Marek Polacek
On Fri, Feb 16, 2024 at 11:00:34AM -0800, Andrew Pinski wrote: > This testcase was fixed by r14-5934-gf26d68d5d128c8 but we should add > one to make sure it does not regress again. > > Committed as obvious after a quick test on the testcase. > > PR c++/97990 > > gcc/testsuite/ChangeLog: >

[PATCH v2] c++: implicit move with throw [PR113853]

2024-02-16 Thread Marek Polacek
On Thu, Feb 15, 2024 at 04:36:40PM -0500, Jason Merrill wrote: > On 2/15/24 10:19, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we have > > > >template > >

[PATCH] c++: wrong looser excep spec for dep noexcept [PR113158]

2024-02-15 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? By the ??? below I mean that maybe_instantiate_noexcept could return a tristate, and then maybe_check_overriding_exception_spec could check if (maybe_instantiate_noexcept ().is_unknown ()) return true; and we don't have to add

[PATCH] c++: wrong looser exception spec with deleted fn

2024-02-15 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? IMHO trivial enough to go ahead now seeing as it doesn't introduce new errors. -- >8 -- I noticed we don't implement the "unless the overriding function is defined as deleted" wording added to [except.spec] via CWG 1351. DR

  1   2   3   4   5   6   7   8   9   10   >