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

            Bug ID: 114569
           Summary: GCC accepts forming pointer to function type which is
                    ref qualified
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

In the following program `#2` is accepts by all compilers but `#1` is rejected.
Shouldn't `#2` also be rejected for the same reason.
https://godbolt.org/z/sMraETcbx

```
#include <type_traits> 
template <class Signature>
struct Decompose;

template <class T>
struct Decompose<void(T)> {
    using Type = T;
};

template <class T>
using FTDecay = typename Decompose<void(T)>::Type;



// static_assert(std::is_same_v<FTDecay<int()&>, int (*)() &>);  //#1: all
rejects this as expected 
 FTDecay<int()&> x{};                                            //#2: all
accepts this why? 
```

Reply via email to