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

[PATCH v2] c++: ICE with nested anonymous union [PR117153]

2025-01-24 Thread Marek Polacek
On Wed, Jan 15, 2025 at 11:55:28AM -0500, Jason Merrill wrote: > On 1/15/25 9:43 AM, Jason Merrill wrote: > > On 11/25/24 4:46 PM, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? > > > > > > -- >8 -- > &g

[PATCH v2] c++: bogus error with nested lambdas [PR117602]

2025-01-23 Thread Marek Polacek
On Tue, Jan 21, 2025 at 05:09:32PM -0500, Jason Merrill wrote: > On 1/16/25 5:42 PM, Marek Polacek wrote: > > On Wed, Jan 15, 2025 at 04:18:36PM -0500, Jason Merrill wrote: > > > On 1/15/25 12:55 PM, Marek Polacek wrote: > > > > On Wed, Jan 15, 2025 at 09:39:4

Re: [PATCH v2] c++: Don't prune constant capture proxies only used in array dimensions [PR114292]

2025-01-23 Thread Marek Polacek
On Thu, Jan 23, 2025 at 02:40:09PM +, Simon Martin wrote: > Hi Jason, > > On 20 Jan 2025, at 22:49, Jason Merrill wrote: > > > On 1/20/25 2:11 PM, Simon Martin wrote: > >> Hi Jason, > >> > >> On 15 Jan 2025, at 22:42, Jason Merrill wrote: > >> > >>> On 12/12/24 2:07 PM, Simon Martin wrote: >

Re: [PATCH v3] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-21 Thread Marek Polacek
On Tue, Jan 21, 2025 at 11:00:13AM -0500, Jason Merrill wrote: > On 1/21/25 9:54 AM, Jason Merrill wrote: > > On 1/20/25 5:58 PM, Marek Polacek wrote: > > > @@ -9087,7 +9092,9 @@ cxx_eval_outermost_constant_expr (tree t, bool > > > allow_non_constant, > > &g

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

2025-01-21 Thread Marek Polacek
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. > > > > On Tue, Nov 26, 2024 at 05:35:50PM -0500, Marek Polacek wrote: > > > Bootstrapped/regtested

[PATCH v3] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-20 Thread Marek Polacek
On Mon, Jan 20, 2025 at 12:39:03PM -0500, Jason Merrill wrote: > On 1/20/25 12:27 PM, Marek Polacek wrote: > > On Mon, Jan 20, 2025 at 11:46:44AM -0500, Jason Merrill wrote: > > > On 1/20/25 10:27 AM, Marek Polacek wrote: > > > > On Fri, Jan 17, 2025 at 06:38:4

Re: [PATCH v2] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-20 Thread Marek Polacek
On Mon, Jan 20, 2025 at 11:46:44AM -0500, Jason Merrill wrote: > On 1/20/25 10:27 AM, Marek Polacek wrote: > > On Fri, Jan 17, 2025 at 06:38:45PM -0500, Jason Merrill wrote: > > > On 1/17/25 1:31 PM, Marek Polacek wrote: > > > > On Fri, Jan 17, 2025 at 08:10:2

Re: [PATCH v2] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-20 Thread Marek Polacek
On Fri, Jan 17, 2025 at 06:38:45PM -0500, Jason Merrill wrote: > On 1/17/25 1:31 PM, Marek Polacek wrote: > > On Fri, Jan 17, 2025 at 08:10:24AM -0500, Jason Merrill wrote: > > > On 1/16/25 8:04 PM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

[PATCH v2] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-17 Thread Marek Polacek
On Fri, Jan 17, 2025 at 08:10:24AM -0500, Jason Merrill wrote: > On 1/16/25 8:04 PM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > The recent r15-6369 unfortunately caused a bad wrong-code issue. > >

[PATCH] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-16 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- The recent r15-6369 unfortunately caused a bad wrong-code issue. Here we have TARGET_EXPR and call cp_fold_r -> maybe_constant_init with object=D.2996. In cxx_eval_outermost_constant_expr we now take the type of the object

Re: [PATCH] c++: bogus error with nested lambdas [PR117602]

2025-01-16 Thread Marek Polacek
On Wed, Jan 15, 2025 at 04:18:36PM -0500, Jason Merrill wrote: > On 1/15/25 12:55 PM, Marek Polacek wrote: > > On Wed, Jan 15, 2025 at 09:39:41AM -0500, Jason Merrill wrote: > > > On 11/15/24 9:08 AM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86

Re: [PATCH] c++: bogus error with nested lambdas [PR117602]

2025-01-15 Thread Marek Polacek
On Wed, Jan 15, 2025 at 09:39:41AM -0500, Jason Merrill wrote: > On 11/15/24 9:08 AM, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > The error here should also check that we aren't nested in another >

Re: [PATCH] c++: dump-lang-raw with obj_type_ref fields

2025-01-14 Thread Marek Polacek
type: @147 expr: @148 obj : @124 tok : @149 > On 2025-01-14 19:03, Marek Polacek wrote: > > On Mon, Jan 13, 2025 at 11:03:54PM +0100, anetczuk wrote: > > > Raw dump of lang tree was missing information about virtual method call. > > Please re

Re: [PATCH] c++: dump-lang-raw with obj_type_ref fields

2025-01-14 Thread Marek Polacek
On Mon, Jan 13, 2025 at 11:03:54PM +0100, anetczuk wrote: > Raw dump of lang tree was missing information about virtual method call. Please resend the patch as an attachment, it's not applicable as-is. > The information is provided in "tok" field of obj_type_ref. > > gcc/ChangeLog: > > * tree-

[PATCH] c++: re-enable NSDMI CONSTRUCTOR folding [PR118355]

2025-01-14 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? -- >8 -- In c++/102990 we had a problem where massage_init_elt got {}, digest_nsdmi_init turned that {} into { .value = (int) 1.0e+0 }, and we crashed in the call to fold_non_dependent_init because a FIX_TRUNC_EXPR/FLOAT_EXPR go

Re: [PATCH] c++: make finish_pseudo_destructor_expr SFINAE-aware [PR116417]

2025-01-13 Thread Marek Polacek
On Mon, Jan 13, 2025 at 11:25:25AM -0500, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > OK for trunk? Looks okay to me. > -- >8 -- > > PR c++/116417 > > gcc/cp/ChangeLog: > > * cp-tree.h (finish_pseudo_destructor_expr): Add complain >

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

2025-01-10 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r15-6740. PR c++/118391 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/lambda-uneval20.C: New test. --- gcc/testsuite/g++.dg/cpp2a/lambda-uneval20.C | 15 +++ 1 file changed, 15 insertions(+) create mode 100

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

2025-01-10 Thread Marek Polacek
Ping. On Fri, Dec 20, 2024 at 08:58:05AM -0500, Marek Polacek wrote: > Ping. > > On Tue, Nov 26, 2024 at 05:35:50PM -0500, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > As the manual states, using

Re: [PATCH] c: Fix up expr location for __builtin_stdc_rotate_* [PR118376]

2025-01-10 Thread Marek Polacek
On Fri, Jan 10, 2025 at 10:45:18AM +0100, Jakub Jelinek wrote: > Hi! > > Seems I forgot to set_c_expr_source_range for the __builtin_stdc_rotate_* > case (the other __builtin_stdc_* cases already have it), which means > the locations in expr are uninitialized, sometimes causing ICEs in linemap > c

Re: [PATCH] c++: Suppress note linked to error suppressed by -Wno-template-body [PR118163]

2025-01-09 Thread Marek Polacek
On Thu, Jan 09, 2025 at 12:05:43PM -0500, Patrick Palka wrote: > On Wed, 8 Jan 2025, Jason Merrill wrote: > > > On 12/21/24 11:35 AM, Simon Martin wrote: > > > When erroring out due to an incomplete type, we add a contextual note > > > about the type. However, when the error is suppressed by > > >

Re: [PATCH] c++: Honor complain in cp_build_function_call_vec for check_function_arguments warnings [PR117825]

2025-01-08 Thread Marek Polacek
On Wed, Jan 08, 2025 at 07:40:32PM +0100, Jakub Jelinek wrote: > On Wed, Jan 08, 2025 at 01:33:15PM -0500, Marek Polacek wrote: > > On Fri, Jan 03, 2025 at 10:46:27PM +0100, Jakub Jelinek wrote: > > > Hi! > > > > > > The following testcase ICEs due to

Re: [PATCH] c++: Honor complain in cp_build_function_call_vec for check_function_arguments warnings [PR117825]

2025-01-08 Thread Marek Polacek
On Fri, Jan 03, 2025 at 10:46:27PM +0100, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs due to re-entering diagnostics. > When diagnosing -Wformat-security warning, we try to print instantiation > context, which calls tsubst with tf_none, but that in the end calls > cp_build_function_

  1   2   3   4   5   6   7   8   9   10   >