[PATCH v3] c++: P2036R3 - Change scope of lambda trailing-return-type [PR102610]

2025-07-16 Thread Marek Polacek
On Mon, Jul 14, 2025 at 12:52:41PM -0400, Jason Merrill wrote: > On 7/11/25 5:49 PM, Marek Polacek wrote: > > On Thu, Jul 10, 2025 at 02:13:06PM -0400, Jason Merrill wrote: > > > On 7/9/25 4:27 PM, Marek Polacek wrote: > > > > On Tue, Jul 08, 2025 at 12:15:0

[PATCH] c++: consteval blocks

2025-07-16 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This patch implements consteval blocks, as specified by P2996. They aren't very useful without define_aggregate, but having a reviewed implementation on trunk would be great. consteval {} can be anywhere where a member-declarat

[PATCH v2] c++: P2036R3 - Change scope of lambda trailing-return-type [PR102610]

2025-07-11 Thread Marek Polacek
On Thu, Jul 10, 2025 at 02:13:06PM -0400, Jason Merrill wrote: > On 7/9/25 4:27 PM, Marek Polacek wrote: > > On Tue, Jul 08, 2025 at 12:15:03PM -0400, Jason Merrill wrote: > > > On 7/7/25 4:52 PM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

Re: [PATCH] c++: P2036R3 - Change scope of lambda trailing-return-type [PR102610]

2025-07-09 Thread Marek Polacek
On Tue, Jul 08, 2025 at 12:15:03PM -0400, Jason Merrill wrote: > On 7/7/25 4:52 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > This patch is an attempt to implement P2036R3 along with P2579R0, fixing

[PATCH] c++: optional template after :: causing error [PR119838]

2025-07-08 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Found while working on Reflection where we currently reject: constexpr auto r = ^^::template C::type; which should work, because "::template C::" should match the nested-name-specifier template(opt) simple-template-id ::

[PATCH] c++: bogus error with union in qualified name [PR83469]

2025-07-08 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- While working on Reflection I noticed that we reject: union U { int i; }; constexpr auto r = ^^typename ::U; which is due to PR83469. Andrew P. posted a patch in 2021: https://gcc.gnu.org/pipermail/gcc-patches/2021-Decemb

[PATCH] c++: P2036R3 - Change scope of lambda trailing-return-type [PR102610]

2025-07-07 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This patch is an attempt to implement P2036R3 along with P2579R0, fixing build breakages caused by P2036R3. The simplest example is: auto counter1 = [j=0]() mutable -> decltype(j) { return j++; }; which currently do

[PATCH v2] c++: fix ICE with [[deprecated]] [PR120756]

2025-06-26 Thread Marek Polacek
On Wed, Jun 25, 2025 at 03:13:25PM -0400, Jason Merrill wrote: > On 6/25/25 1:28 PM, Marek Polacek wrote: > > @@ -24604,7 +24604,7 @@ resolve_nondeduced_context (tree orig_expr, > > tsubst_flags_t complain) > > } > > if (good == 1) > >

[PATCH] c++: fix ICE with [[deprecated]] [PR120756]

2025-06-25 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? -- >8 -- Here we end up with "error reporting routines re-entered" because resolve_nondeduced_context isn't passing complain to mark_used. PR c++/120756 gcc/cp/ChangeLog: * pt.cc (resolve_nondeduced_context):

Re: [wwwdocs] Add C2y status table

2025-06-23 Thread Marek Polacek
On Thu, Jun 12, 2025 at 07:13:13PM +, Joseph Myers wrote: > On Thu, 12 Jun 2025, Marek Polacek wrote: > > > + > > + > > +Support ++ and -- on complex values > > + > href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3259.pdf";>

Re: [wwwdocs v2] Add C23 status table

2025-06-23 Thread Marek Polacek
On Thu, Jun 19, 2025 at 08:36:42PM +, Joseph Myers wrote: > On Fri, 13 Jun 2025, Marek Polacek wrote: > > > doesn't need any changes, I think. Another is "modified existing functions > > to preserve the const-ness of the type placed into the function", I don

Re: [PATCH] c++: ICE with unexpanded pack in asm

2025-06-13 Thread Marek Polacek
On Wed, Jun 04, 2025 at 09:18:45PM +0800, yxj-github-437 wrote: > > This line seems wrongly indented, should be only two spaces more > > than the if line: > > > > if (check_for_bare_parameter_packs (expression)) > >expression = error_mark_node; > > > > > > The patch LGTM otherwise, thanks. >

[wwwdocs v2] Add C23 status table

2025-06-13 Thread Marek Polacek
On Thu, Jun 12, 2025 at 05:39:26PM +, Joseph Myers wrote: > On Wed, 11 Jun 2025, Marek Polacek wrote: > > > This patch adds the C23 Support in GCC table (compiler features only). > > > > While creating it, I've consulted Annex M.2, our own changes.html, > &g

Re: [wwwdocs] Add C2y status table

2025-06-12 Thread Marek Polacek
On Thu, Jun 12, 2025 at 06:59:02PM +0200, Jakub Jelinek wrote: > On Thu, Jun 12, 2025 at 12:50:00PM -0400, Marek Polacek wrote: > > + > > + > > +More Modern Bit Utilities > > + > href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3367.htm&q

[wwwdocs] Add C2y status table

2025-06-12 Thread Marek Polacek
To be applied on top of the C23 status table patch. W3 validated. Ok? -- >8 -- diff --git a/htdocs/projects/c-status.html b/htdocs/projects/c-status.html index 7e522bc3..5bee3e25 100644 --- a/htdocs/projects/c-status.html +++ b/htdocs/projects/c-status.html @@ -31,7 +31,6 @@ GCC has experimenta

[wwwdocs] Add C23 status table

2025-06-11 Thread Marek Polacek
This patch adds the C23 Support in GCC table (compiler features only). While creating it, I've consulted Annex M.2, our own changes.html, Joseph's "ISO C23 support in the GNU Toolchain" Cauldron presentation, https://en.cppreference.com/w/c/compiler_support.html, https://clang.llvm.org/c_status.ht

[wwwdocs] Add C status page (C11 table)

2025-06-10 Thread Marek Polacek
This patch adds a C11 status table to c-status.html. I consulted n3220.pdf (M.4) and https://gcc.gnu.org/wiki/C11Status, and checked that Implemented in Version is correct. I've added links to proposals where it seemed relevant. Also add a small note about C17. W3 validated. Ok? --- htdocs/gcc-

[wwwdocs] Add C status page (check, small tweaks)

2025-06-09 Thread Marek Polacek
I've checked our C99 status table against the list in Annex M.5 in C23 (n3220). I found no issues. This patch renames the title of our C status page in preparation for adding C11 and C23 lists. W3 validated. Ok? --- htdocs/projects/c-status.html | 27 --- 1 file changed

Re: [wwwdocs] Add C status page (rename c99status.html)

2025-06-05 Thread Marek Polacek
On Thu, Jun 05, 2025 at 08:46:25PM +, Joseph Myers wrote: > On Thu, 5 Jun 2025, Marek Polacek wrote: > > > Also adjust redirects. > > I don't see the .htaccess updates here, the existing redirects should be > updated and a new one for /c99status.html added. Like

[PATCH] doc: update links to c99status.html

2025-06-05 Thread Marek Polacek
Once we rename and move c99status.html, we also have to update the links in the manual. -- >8 -- gcc/ChangeLog: * doc/invoke.texi: Update a link to c99status.html. * doc/standards.texi: Likewise. --- gcc/doc/invoke.texi| 4 ++-- gcc/doc/standards.texi | 4 ++-- 2 files change

[wwwdocs] Add C status page (rename c99status.html)

2025-06-05 Thread Marek Polacek
CC manual to follow. Ok for wwwdocs? -- >8 -- >From 62e30c69e991f448be9c10881c8749f0ce98ce70 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 5 Jun 2025 15:46:46 -0400 Subject: [PATCH] Rename c99status.html to projects/c-status.html Also adjust redirects. --- htdocs/gcc-

Re: [PATCH] c++: ICE with unexpanded pack in asm

2025-06-03 Thread Marek Polacek
On Wed, Jun 04, 2025 at 01:28:39AM +0800, yxj-github-437 wrote: > Here an unexpanded parameter pack pass into asm_operand which doesn't > expect to see an operand without type. So use check_for_bare_parameter_packs > to remedy that. > > gcc/cp/ChangeLog: > > * parse.cc (cp_parser_asm_operan

Re: [PATCH] c: Allow $@` in GNU23/GNU2Y raw string delimiters [PR110343]

2025-04-24 Thread Marek Polacek
On Wed, Apr 16, 2025 at 09:25:00PM +0200, Jakub Jelinek wrote: > Hi! > > Aaron mentioned in the PR that late in C23 N3124 was adopted and > $@` are now part of basic character set. The paper has been implemented > in GCC from what I can see, but we should allow for GNU23/2Y $@` in > raw string de

Re: [PATCH v2] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Marek Polacek
On Tue, Apr 15, 2025 at 06:46:26PM +, Qing Zhao wrote: > This is the 2nd version of the patch, the change is to replace "FALSE" with > "false" per Marek's comments. > > C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. > In c_fully_fold, it assumes that operands of fu

Re: [PATCH] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Marek Polacek
On Mon, Apr 14, 2025 at 08:28:55PM +, Qing Zhao wrote: > C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. > In c_fully_fold, it assumes that operands of function calls have already > been folded. However, when we build call to .ACCESS_WITH_SIZE, all its > operands are

Re: [PATCH] lto: lto-opts fixes [PR119625]

2025-04-09 Thread Marek Polacek
On Fri, Apr 04, 2025 at 08:56:40PM +0200, Jakub Jelinek wrote: > On Fri, Apr 04, 2025 at 08:52:10PM +0200, Richard Biener wrote: > > > Or do you want something further (like > > > switch (global_options.x_flag_cf_protection & ~CF_SET) > > > )? > > > > Dunno what that CF_SET is, we’re supposed to r

Re: [PATCH] libcpp: Fix error recovery after use of __VA_ARGS__ as macro argument [PR118674]

2025-04-08 Thread Marek Polacek
On Tue, Apr 08, 2025 at 10:19:58AM +0200, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs after emitting one pedwarn (about using > __VA_ARGS__ in a place where it shouldn't be used) and one error. > The error is emitted by _cpp_save_parameter where it sees the node > has been used alre

Re: [PATCH] c-family: Improve location for -Wunknown-pragmas in a _Pragma [PR118838]

2025-04-07 Thread Marek Polacek
On Wed, Feb 12, 2025 at 08:27:37PM -0500, Lewis Hyatt wrote: > Hello- > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118838 > > This patch addresses the issue mentioned in the PR (another instance of > _Pragma string location issues). bootstrap + regtest all languages on > aarch64 looks good. I

[PATCH v2] c++: fix missing lifetime extension [PR119383]

2025-04-04 Thread Marek Polacek
On Thu, Mar 27, 2025 at 11:27:04AM -0400, Jason Merrill wrote: > On 3/25/25 3:37 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? > > > > -- >8 -- > > Since r15-8011 cp_build_indirect_ref_1 won't do the *&TARGET

Re: [PATCH] c: Fix ICEs with -fsanitize=pointer-{subtract,compare} [PR119582]

2025-04-02 Thread Marek Polacek
On Wed, Apr 02, 2025 at 06:38:12PM +0200, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs because c_fully_fold isn't performed on the > arguments of __sanitizer_ptr_{sub,cmp} builtins and so e.g. > C_MAYBE_CONST_EXPR can leak into the gimplifier where it ICEs. > > Fixed thusly, bootstr

Re: [PATCH RFC] c++: optimize push_to_top_level [PR64500]

2025-04-02 Thread Marek Polacek
On Fri, Mar 28, 2025 at 10:02:28PM -0400, Patrick Palka wrote: > On Fri, 28 Mar 2025, Jason Merrill wrote: > > > Tested x86_64-pc-linux-gnu, initially with extra checking to make sure that > > indeed nothing got saved from a namespace level. > > > > This isn't a regression, but a 20% speedup for

Re: [PATCH] c++: Fix typo in RAW_DATA_CST build_list_conv subsubconv hanling [PR119563]

2025-04-01 Thread Marek Polacek
On Tue, Apr 01, 2025 at 04:31:38PM +0200, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs (the embed one actually doesn't but > dereferences random uninitialized pointer far after allocated memory) > because of a typo. In the RAW_DATA_CST handling of list conversion > where there are c

[PATCH v3] c++: fix reporting routines re-entered [PR119303]

2025-03-28 Thread Marek Polacek
On Fri, Mar 28, 2025 at 11:49:48AM -0400, Jason Merrill wrote: > On 3/27/25 5:00 PM, Marek Polacek wrote: > > On Wed, Mar 19, 2025 at 12:00:00PM -0400, Jason Merrill wrote: > > > On 3/17/25 6:55 PM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

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

2025-03-27 Thread Marek Polacek
~90 new DRs. More updates tomorrow. Pushed. -- >8 -- commit eabbf82b95871f4cc1561b9d5bd9ba88a849a61f Author: Marek Polacek Date: Thu Mar 27 19:08:35 2025 -0400 cxx-dr-status: Update from C++ Core Language Issue TOC, Revision 116 diff --git a/htdocs/projects/cxx-dr-status.html b/htd

[PATCH v2] c++: fix reporting routines re-entered [PR119303]

2025-03-27 Thread Marek Polacek
On Wed, Mar 19, 2025 at 12:00:00PM -0400, Jason Merrill wrote: > On 3/17/25 6:55 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > We crash while we call warning_at ("inline function used but n

[pushed] testsuite: fix g++.dg/template/explicit-args6.C

2025-03-27 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- gcc/testsuite/ChangeLog: * g++.dg/template/explicit-args6.C: Remove an extra set of {} in a dg-message. --- gcc/testsuite/g++.dg/template/explicit-args6.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g

Re: [PATCH v2] c++: Fix FAIL: g++.dg/tree-ssa/initlist-opt1.C

2025-03-27 Thread Marek Polacek
On Wed, Mar 26, 2025 at 05:57:51PM +, Jonathan Wakely wrote: > On Wed, 26 Mar 2025 at 17:42, Jason Merrill wrote: > > > > On 3/26/25 6:14 AM, Jonathan Wakely wrote: > > > My r15-8904-ge200f53a555651 changed the std::vector initializer-list > > > constructor so that it calls a new _M_range_init

Re: [PATCH 5/6] testsuite: fix more dg-* whitespace issues

2025-03-27 Thread Marek Polacek
On Thu, Mar 27, 2025 at 12:38:55AM +, Sam James wrote: > A handful of cosmetic ones in here but most meant the directive wasn't > doing anything. This patch breaks g++.dg/template/explicit-args6.C for me. > gcc/testsuite/ChangeLog: > > * g++.dg/cpp0x/udlit-namespace-ambiguous.C: Fix w

[PATCH] c++: fix missing lifetime extension [PR119383]

2025-03-25 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? -- >8 -- Since r15-8011 cp_build_indirect_ref_1 won't do the *&TARGET_EXPR -> TARGET_EXPR folding not to change its value category. That fix is correct but it made us stop extending the lifetime in this testcase, causing a wrong-code

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

2025-03-25 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed recently by r15-7822. PR c++/101881 gcc/testsuite/ChangeLog: * g++.dg/ext/vector44.C: New test. --- gcc/testsuite/g++.dg/ext/vector44.C | 5 + 1 file changed, 5 insertions(+) create mode 100644 gcc/testsuite/g++

Re: [PATCH] c++: Properly fold .* [PR114525]

2025-03-25 Thread Marek Polacek
On Tue, Mar 25, 2025 at 05:18:23PM +, Simon Martin wrote: > We've been miscompiling the following since r0-51314-gd6b4ea8592e338 (I > did not go compile something that old, and identified this change via > git blame, so might be wrong) > > === cut here === > struct Foo { int x; }; > Foo& get (

Re: [PATCH] C++: Adjust implicit '__cxa_bad_cast' prototype to reality

2025-03-19 Thread Marek Polacek
On Wed, Mar 19, 2025 at 12:38:31PM +0100, Thomas Schwinge wrote: > In 2001 Subversion r40924 (Git commit > 52a11cbfcf0cfb32628b6953588b6af4037ac0b6) > "IA-64 ABI Exception Handling", '__cxa_bad_cast' changed from 'void *' to > 'void' return type: > > --- libstdc++-v3/libsupc++/exception_suppo

[PATCH v2] c++: ICE with ptr-to-member-fn [PR119344]

2025-03-18 Thread Marek Polacek
On Tue, Mar 18, 2025 at 04:19:12PM -0400, Jason Merrill wrote: > On 3/18/25 3:12 PM, Marek Polacek wrote: > > On Tue, Mar 18, 2025 at 03:05:57PM -0400, Patrick Palka wrote: > > > On Tue, 18 Mar 2025, Marek Polacek wrote: > > > > > > > Bootstrapped/regtested

Re: [PATCH] c++: ICE with ptr-to-member-fn [PR119344]

2025-03-18 Thread Marek Polacek
On Tue, Mar 18, 2025 at 03:05:57PM -0400, Patrick Palka wrote: > On Tue, 18 Mar 2025, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? > > > > -- >8 -- > > This ICE appeared with the removal of NON_DEPENDENT_EXPR. Prev

[PATCH] c++: ICE with ptr-to-member-fn [PR119344]

2025-03-18 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? -- >8 -- This ICE appeared with the removal of NON_DEPENDENT_EXPR. Previously skip_simple_arithmetic would get NON_DEPENDENT_EXPR> and since NON_DEPENDENT_EXPR is neither BINARY_CLASS_P nor UNARY_CLASS_P, there was no problem. But n

[PATCH v2] c++: ICE when substituting packs into type aliases [PR118104]

2025-03-18 Thread Marek Polacek
On Mon, Mar 17, 2025 at 10:30:45PM -0400, Patrick Palka wrote: > On Mon, 17 Mar 2025, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14/13? > > > > -- >8 -- > > r12-1094 mentions that adding the assert didn't lead t

[PATCH] c++: fix reporting routines re-entered [PR119303]

2025-03-17 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- We crash while we call warning_at ("inline function used but never defined") since it invokes dump_template_bindings -> tsubst -> ... -> convert_like -> ... -> c_common_truthvalue_conversion -> warning_at ("enum constant in bool

[PATCH] c++: ICE when substituting packs into type aliases [PR118104]

2025-03-17 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14/13? -- >8 -- r12-1094 mentions that adding the assert didn't lead to any regressions in the testsuite, but this test case demonstrates that we can reach it with valid code. Here we arrive in use_pack_expansion_extra_args_p with t whic

[PATCH v2] c++: ICE with aligned member and trivial assign op [PR117512]

2025-03-12 Thread Marek Polacek
On Wed, Mar 12, 2025 at 12:28:58AM -0400, Jason Merrill wrote: > On 3/10/25 6:31 PM, Marek Polacek wrote: > > build_over_call has: > > > > t = build2 (MODIFY_EXPR, void_type_node, > > build2 (MEM_REF, array_type, arg0, alias_set), > >

[PATCH] c++: ICE with aligned member and trivial assign op [PR117512]

2025-03-11 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? -- >8 -- build_over_call has: t = build2 (MODIFY_EXPR, void_type_node, build2 (MEM_REF, array_type, arg0, alias_set), build2 (MEM_REF, array_type, arg, alias_set)); val

Re: [PATCH] c++: Evaluate immediate invocation call arguments with mce_true [PR119150]

2025-03-07 Thread Marek Polacek
On Fri, Mar 07, 2025 at 05:53:58PM +0100, Jakub Jelinek wrote: > Hi! > > Since Marek's r14-4140 which moved immediate invocation evaluation > from build_over_call to cp_fold_r, the following testcase is miscompiled. > > The a = foo (bar ()); case is actually handled right, that is handled > in cp

Re: [PATCH v2] c++: ICE with operator new[] in constexpr [PR118775]

2025-03-07 Thread Marek Polacek
On Fri, Mar 07, 2025 at 12:00:00PM -0500, Jason Merrill wrote: > On 3/6/25 5:13 PM, Marek Polacek wrote: > > On Wed, Mar 05, 2025 at 05:28:49PM -0500, Jason Merrill wrote: > > > On 3/5/25 4:00 PM, Marek Polacek wrote: > > > > On Wed, Mar 05, 2025 at 03:31:5

[PATCH] c++: ICE with lambda in fold expression in requires [PR119134]

2025-03-07 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? -- >8 -- The r12-8258 fix assumes that DECL_CONTEXT of 'pack' in check_for_bare_parameter_packs is going to be an operator() but as this test shows, it can be empty. PR c++/119134 gcc/cp/ChangeLog: * pt.cc (ch

Re: [PATCH v2] c++: ICE with operator new[] in constexpr [PR118775]

2025-03-06 Thread Marek Polacek
On Wed, Mar 05, 2025 at 05:28:49PM -0500, Jason Merrill wrote: > On 3/5/25 4:00 PM, Marek Polacek wrote: > > On Wed, Mar 05, 2025 at 03:31:59PM -0500, Jason Merrill wrote: > > > On 3/5/25 12:09 PM, Marek Polacek wrote: > > > > On Tue, Mar 04, 2025 at 05:34:1

Re: [PATCH v2] c++: ICE with operator new[] in constexpr [PR118775]

2025-03-05 Thread Marek Polacek
On Wed, Mar 05, 2025 at 03:31:59PM -0500, Jason Merrill wrote: > On 3/5/25 12:09 PM, Marek Polacek wrote: > > On Tue, Mar 04, 2025 at 05:34:10PM -0500, Jason Merrill wrote: > > > On 2/11/25 6:24 PM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

[PATCH v2] c++: ICE with operator new[] in constexpr [PR118775]

2025-03-05 Thread Marek Polacek
On Tue, Mar 04, 2025 at 05:34:10PM -0500, Jason Merrill wrote: > On 2/11/25 6:24 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we ICE since r11-7740 because we no longer say that (long)&

[PATCH v2] c++: disable -Wnonnull in unevaluated context [PR115580]

2025-03-05 Thread Marek Polacek
On Tue, Mar 04, 2025 at 04:41:05PM -0500, Jason Merrill wrote: > On 3/4/25 3:26 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > This PR complains that we issue a -Wnonnull even in a de

[PATCH] c++: disable -Wnonnull in unevaluated context [PR115580]

2025-03-04 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This PR complains that we issue a -Wnonnull even in a decltype. Since we can't use cp_unevaluated_operand in c-common.cc, this fix targets even -Wformat and -Wrestrict. I think that's fine. PR c++/115580 gcc/cp/Change

Re: [PATCH] c++: ICE with operator new[] in constexpr [PR118775]

2025-03-04 Thread Marek Polacek
Ping. On Tue, Feb 11, 2025 at 06:24:32PM -0500, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > Here we ICE since r11-7740 because we no longer say that (long)&a > (where a is a global var) is non_constant_p. So VERI

[PATCH] c++: ICE with RANGE_EXPR and array init [PR109431]

2025-02-28 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? -- >8 -- We crash because we generate {[0 ... 1]={.low=0, .high=1}, [1]={.low=0, .high=1}} which output_constructor_regular_field doesn't want to see. This happens since r9-1483: process_init_constructor_array can now creat

[PATCH v2] c++: ICE in replace_decl [PR118986]

2025-02-27 Thread Marek Polacek
On Thu, Feb 27, 2025 at 10:42:07AM -0500, Jason Merrill wrote: > On 2/26/25 2:16 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Yet another problem that started with r15-6052, compile t

Re: [PATCH] c++: ICE with GOTO_EXPR [PR118928]

2025-02-27 Thread Marek Polacek
On Thu, Feb 27, 2025 at 01:15:12PM -0500, Jason Merrill wrote: > On 2/20/25 9:51 AM, Marek Polacek wrote: > > Now with the test fixed. > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > In this PR we crash in

[PATCH] c++: ICE in replace_decl [PR118986]

2025-02-26 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Yet another problem that started with r15-6052, compile time evaluation of prvalues. cp_fold_r/TARGET_EXPR sees: TARGET_EXPR >>> so when we call maybe_constant_init, the object we're initializing is D.2701, and the ini

[PATCH] c++: too many errors with sneaky template [PR118516]

2025-02-20 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Since C++20 P0846, a name followed by a < can be treated as a template-name even though name lookup did not find a template-name. That happens in this test with "i < foo ()": for (int id = 0; i < foo(); ++id); and results i

Re: [PATCH] c++: ICE with GOTO_EXPR [PR118928]

2025-02-20 Thread Marek Polacek
Now with the test fixed. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In this PR we crash in cxx_eval_constant_expression/GOTO_EXPR on: gcc_assert (cxx_dialect >= cxx23); The code obviously doesn't expect to see a goto pre-C++23. But we can get here with the new prva

[PATCH] c++: ICE with GOTO_EXPR [PR118928]

2025-02-19 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In this PR we crash in cxx_eval_constant_expression/GOTO_EXPR on: gcc_assert (cxx_dialect >= cxx23); The code obviously doesn't expect to see a goto pre-C++23. But we can get here with the new prvalue optimization. In this

[PATCH v2] c++: fix rejects-valid and ICE with constexpr NSDMI [PR110822]

2025-02-19 Thread Marek Polacek
On Wed, Feb 19, 2025 at 10:14:21AM -0500, Patrick Palka wrote: > On Wed, 19 Feb 2025, Marek Polacek wrote: > > > I suppose it's safer to leave this for GCC 16, but anyway: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu. > > > > -- >8 -- >

[PATCH] c++: fix rejects-valid and ICE with constexpr NSDMI [PR110822]

2025-02-19 Thread Marek Polacek
I suppose it's safer to leave this for GCC 16, but anyway: Bootstrapped/regtested on x86_64-pc-linux-gnu. -- >8 -- Since r10-7718 the attached tests produce an ICE in verify_address: error: constant not recomputed when 'ADDR_EXPR' changed but before that we wrongly rejected the tests with "is

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

2025-02-17 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r13-4564 but the tests are very different. PR c++/102455 gcc/testsuite/ChangeLog: * g++.dg/ext/vector43.C: New test. --- gcc/testsuite/g++.dg/ext/vector43.C | 7 +++ 1 file changed, 7 insertions(+) create mod

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

2025-02-17 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- We were rejecting this, but the test compiles correctly since r14-6346. PR c++/96364 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/gen-attrs-88.C: New test. --- gcc/testsuite/g++.dg/cpp0x/gen-attrs-88.C | 14 ++ 1 fi

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r12-4425 and it seemed worth adding. PR c++/83144 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-83144.C: New test. --- gcc/testsuite/g++.dg/cpp0x/constexpr-83144.C | 21 1 file changed, 21

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 11:04:09PM +0100, Jason Merrill wrote: > On 2/14/25 4:29 PM, Marek Polacek wrote: > > On Fri, Feb 14, 2025 at 09:30:34AM -0500, Patrick Palka wrote: > > > On Thu, 13 Feb 2025, Marek Polacek wrote: > > > > > > > Bootstrapped/regtest

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r8-6829-gaaec81f10fa314; before that: Segmentation fault (core dumped) PR c++/82936 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/vt-82936.C: New test. --- gcc/testsuite/g++.dg/cpp0x/vt-82936.C | 18 ++

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r10-3735. PR c++/82794 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr82794.C: New test. --- gcc/testsuite/g++.dg/cpp2a/concepts-pr82794.C | 8 1 file changed, 8 insertions(+) create mode 100644

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r11-735 + r11-2417. PR c++/70037 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr70037.C: New test. --- gcc/testsuite/g++.dg/cpp2a/concepts-pr70037.C | 18 ++ 1 file changed, 18 insertions(+) c

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r11-175. PR c++/66878 gcc/testsuite/ChangeLog: * g++.dg/lookup/using71.C: New test. --- gcc/testsuite/g++.dg/lookup/using71.C | 12 1 file changed, 12 insertions(+) create mode 100644 gcc/testsuite/g

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

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r10-6464. PR c++/66519 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-parm2.C: New test. --- gcc/testsuite/g++.dg/cpp0x/variadic-parm2.C | 12 1 file changed, 12 insertions(+) create mode 100644 gc

Re: [PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 04:45:01PM +, Simon Martin wrote: > Hi Marek, > > On 14 Feb 2025, at 17:27, Marek Polacek wrote: > > > On Fri, Feb 14, 2025 at 04:20:07PM +, Simon Martin wrote: > >> The case in this PR does not ICE anymore after the fix for PR118319.

Re: [PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 04:20:07PM +, Simon Martin wrote: > The case in this PR does not ICE anymore after the fix for PR118319. > > This patch simply adds the case to the testsuite. > > Successfully tested on x86_64-apple-darwin19.6.0. > > PR c++/117324 > > gcc/testsuite/ChangeLog: >

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 09:30:34AM -0500, Patrick Palka wrote: > On Thu, 13 Feb 2025, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we have: > > > > template > > struct

[PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-13 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we have: template struct X{ T val; decltype(auto) value(){ return (val); } }; where the return type of value should be 'int &' since '(val)' is an expression, not a name, and decltype(aut

Re: [PATCH] driver: -fhardened and -z lazy/-z norelro [PR117739]

2025-02-13 Thread Marek Polacek
Ping. On Thu, Feb 06, 2025 at 11:26:48AM -0500, Marek Polacek wrote: > Ping. > > On Tue, Jan 21, 2025 at 11:05:46AM -0500, Marek Polacek wrote: > > Ping. > > > > On Fri, Jan 10, 2025 at 03:07:52PM -0500, Marek Polacek wrote: > > > Ping. > > > &

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

2025-02-12 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r12-3643. PR c++/101740 gcc/testsuite/ChangeLog: * g++.dg/template/dtor12.C: New test. --- gcc/testsuite/g++.dg/template/dtor12.C | 19 +++ 1 file changed, 19 insertions(+) create mode 100644 gcc/

[PATCH] c++: P2308, Template parameter initialization (tests) [PR113800]

2025-02-12 Thread Marek Polacek
Tested on x86_64-pc-linux-gnu, ok for trunk? I'll also update cxx-status.html. -- >8 -- This proposal was implemented a long time ago by my r9-5271, but it took me this long to verify that it still works as per P2308. This patch adds assorted tests, both from clang and from [temp.arg.nontype]. F

[PATCH] c++: ICE with operator new[] in constexpr [PR118775]

2025-02-11 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we ICE since r11-7740 because we no longer say that (long)&a (where a is a global var) is non_constant_p. So VERIFY_CONSTANT does not return and we crash on tree_to_uhwi. We should check tree_fits_uhwi_p before calling tr

[PATCH] c++: ICE with unparsed noexcept [PR117106]

2025-02-06 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In a member-specification of a class, a noexcept-specifier is a complete-class context. Thus we delay parsing until the end of the class via our DEFERRED_PARSE mechanism; see cp_parser_save_noexcept and cp_parser_late_noexcept_

Re: [PATCH] c++: Allow constexpr reads from volatile std::nullptr_t objects [PR118661]

2025-02-06 Thread Marek Polacek
On Thu, Feb 06, 2025 at 07:32:43PM +0100, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, https://eel.is/c++draft/conv.lval#note-1 > says that even volatile reads from std::nullptr_t typed objects actually > don't read anything and https://eel.is/c++draft/expr.const#10.9 > says that even th

Re: [PATCH] driver: -fhardened and -z lazy/-z norelro [PR117739]

2025-02-06 Thread Marek Polacek
Ping. On Tue, Jan 21, 2025 at 11:05:46AM -0500, Marek Polacek wrote: > Ping. > > On Fri, Jan 10, 2025 at 03:07:52PM -0500, Marek Polacek wrote: > > Ping. > > > > On Fri, Dec 20, 2024 at 08:58:05AM -0500, Marek Polacek wrote: > > > Ping. > > > &

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

2025-02-04 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- The recent r15-7339-g26d3424ca5d9f4 fixed this test too. PR c++/94100 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic188.C: New test. --- gcc/testsuite/g++.dg/cpp0x/variadic188.C | 23 +++ 1 file chang

[wwwdocs] Document some further C++ FE changes

2025-02-04 Thread Marek Polacek
W3 validated. Pushed. commit 3c9e703a45f36113ace827463e6f0240fea334a2 Author: Marek Polacek Date: Tue Feb 4 17:20:18 2025 -0500 Document some further C++ FE changes. diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html index 14dea6f4..18484915 100644 --- a/htdocs/gcc-15

Re: [PATCH v2] c++: Reject cdtors and conversion operators with a single * as return type [PR118306]

2025-02-04 Thread Marek Polacek
On Tue, Feb 04, 2025 at 10:39:44AM -0500, Jason Merrill wrote: > Does this also fix 118304? If so, let's go ahead and apply it to GCC 15. It does not, with this patch we emit an error, but still crash on struct A { *A() = default; }; Marek

[PATCH] c++: ICE on invalid 'tor with =default [PR118304]

2025-02-03 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In this PR we crash in maybe_delete_defaulted_fn because the switch doesn't expect a cfk_constructor/_destructor. But we can get there: struct A { *A() = default; }; is invalid due to the void/void* mismatch, so we ge

Re: [PATCH] c++: Fix up pedwarn for capturing structured bindings in lambdas [PR118719]

2025-02-03 Thread Marek Polacek
On Sun, Feb 02, 2025 at 11:14:55AM +0100, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, this pedwarni is desirable for the implicit or > explicit capturing of structured bindings in C++17, but in the case of > init-captures the initializer is just some expression and that can include > st

[PATCH v2] c++: auto in trailing-return-type in parameter [PR117778]

2025-01-31 Thread Marek Polacek
On Fri, Jan 31, 2025 at 09:34:52AM -0500, Jason Merrill wrote: > On 1/30/25 5:24 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? > > > > -- >8 -- > > This PR describes a few issues, both ICE and rejects-valid, but > &g

[PATCH] c++: bogus -Wvexing-parse with trailing-return-type [PR118718]

2025-01-31 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This warning should not warn for auto f1 () -> auto; because that cannot be confused with initializing a variable. PR c++/118718 gcc/cp/ChangeLog: * parser.cc (warn_about_ambiguous_parse): Don't warn when

[PATCH] c++: auto in trailing-return-type in parameter [PR117778]

2025-01-30 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? -- >8 -- This PR describes a few issues, both ICE and rejects-valid, but ultimately the problem is that we don't properly synthesize the second auto in: int g (auto fp() -> auto) { return fp (); } since r12-5860, which d

[PATCH v2] c++: wrong-code with consteval constructor [PR117501]

2025-01-30 Thread Marek Polacek
On Wed, Jan 29, 2025 at 08:03:37AM -0500, Jason Merrill wrote: > On 1/27/25 6:19 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? > > > > -- >8 -- > > We've had a wrong-code problem since r14-4140, due to which we

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

2025-01-29 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r11-2412. PR c++/57533 gcc/testsuite/ChangeLog: * g++.dg/eh/throw5.C: New test. --- gcc/testsuite/g++.dg/eh/throw5.C | 23 +++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite

Re: Ping (was: rs6000: Add -msplit-patch-nops (PR112980))

2025-01-28 Thread Marek Polacek
I would also like to ping this patch. On Thu, Jan 09, 2025 at 04:15:24PM +0100, Michael Matz wrote: > Hello, > > On Wed, 13 Nov 2024, Michael Matz wrote: > > > Hello, > > > > this is essentially > > > > https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651025.html > > > > from Kewen in fu

[PATCH] c++: wrong-code with consteval constructor [PR117501]

2025-01-27 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? -- >8 -- We've had a wrong-code problem since r14-4140, due to which we forget to initialize a variable. In consteval39.C, we evaluate struct QQQ q; <>> (const char *) "" ) >; into struct QQQ q; <; a

  1   2   3   4   5   6   7   8   9   10   >