[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26 since r16-4338

2026-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26 since r16-4338

2026-02-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:5f75fc37b131c701a5b5c627239fa4e4dfabe230

commit r16-7358-g5f75fc37b131c701a5b5c627239fa4e4dfabe230
Author: Jakub Jelinek 
Date:   Fri Feb 6 11:27:52 2026 +0100

tree: Fix up build_function_type for (...) fntypes [PR123977]

The following testcase ICEs in -std=c++26 mode since my r16-4338 C++26
va_start changes.
The problem is that if we have anything non-canonical in a function
type with (...) in C++26 (or C23/C2Y) mode, in this case the R typedef
on return type rather than void, then we try to build TYPE_CANONICAL
for that, but weren't passing in the no_named_args_stdarg_p, so
a type with TYPE_NO_NAMED_ARGS_STDARG_P flag set got TYPE_CANONICAL
with TYPE_NO_NAMED_ARGS_STDARG_P flag cleared and comptypes then
didn't like that as those aren't really compatible types
(...) vs. the C89-ish () which even C++ uses for some type-generic
etc. builtins.

2026-02-05  Jakub Jelinek  

PR c++/123977
* tree.cc (build_function_type): Pass no_named_args_stdarg_p
as last argument to recursive call.

* g++.dg/cpp26/stdarg10.C: New test.

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26 since r16-4338

2026-02-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |ASSIGNED

--- Comment #5 from Jakub Jelinek  ---
Created attachment 63599
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63599&action=edit
gcc16-pr123977.patch

Untested fix.

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26 since r16-4338

2026-02-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
Summary|[16 Regression] ICE on  |[16 Regression] ICE on
   |member function pointer in  |member function pointer in
   |C++26   |C++26 since r16-4338
   Keywords|needs-bisection |

--- Comment #4 from Jakub Jelinek  ---
Started with my r16-4338-g4e44fe4280bf2d9ddc135dec18ec109805c539b9
Will have a look.

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26

2026-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

--- Comment #3 from Andrew Pinski  ---
Created attachment 63588
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63588&action=edit
Reduced testcase without templates

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26

2026-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

Andrew Pinski  changed:

   What|Removed |Added

 Blocks||101603
   Keywords||rejects-valid

--- Comment #2 from Andrew Pinski  ---
With -fno-checking, trunk rejects it:
```
: In instantiation of 'static void TestCaseImp::run() [with
CallSig = void*&(...) const volatile]':
required from here
:11:48:   
   11 |   TestCaseImp::run;
  |^
:8:23: error: no matches converting function 'f' to type 'void*&
(struct MemFun03::*)(...) const volatile'
8 |   static void run() { (CallSig(MemFun03::*)) &MemFun03::f; }
  |   ^~~
  • there are 2 candidates
• candidate 1: 'void MemFun03::f()'
  :5:8:
  5 |   void f();
|^
• candidate 2: 'void*& MemFun03::f(...) const volatile'
  :4:5:
  4 |   R f(...) const volatile;
| ^
```


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101603
[Bug 101603] [meta-bug] pointer to member functions issues

[Bug c++/123977] [16 Regression] ICE on member function pointer in C++26

2026-02-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123977

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2026-02-04
   Priority|P3  |P1
   Keywords||ice-on-valid-code
   Target Milestone|--- |16.0
 CC||mpolacek at gcc dot gnu.org
Summary|ICE on member function  |[16 Regression] ICE on
   |pointer in C++26|member function pointer in
   ||C++26
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.  Can't bisect ATM.