https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125764

            Bug ID: 125764
           Summary: can_substitute returns false for function types with
                    reference return type
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.keane051 at gmail dot com
  Target Milestone: ---

Created attachment 64721
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64721&action=edit
An error log from gcc-trunk.

The code below should compile, but the static assertion fails on my local build
of g++ 17.0.0 20260517. 

Compiled with: g++ -freflection -std=c++26

```
#include <meta>

template <typename T>
struct S {};

static_assert(can_substitute(^^S, {^^int&()}));
```

Additionally, I tested with 'x86-64 gcc (trunk)' on Compiler Explorer and
received the attached error.txt. Unfortunately, since it's not on my local
machine, I can't access the output file from -freport-bug, however I hope the
example is small enough that it can be reproduced and extracted.

Reply via email to