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

            Bug ID: 125188
           Summary: Incorrect result of decltype(auto) on parenthesized
                    class type template parameter
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkaminsk at gcc dot gnu.org
  Target Milestone: ---

In the following example the type of ``value`` is deduced to `Obj const` and
not `Obj const&`, and static_assertions fails:
```
template<auto X>
struct cw
{
    static constexpr decltype(auto) value = (X);
    static_assert(std::is_same_v<decltype(value), decltype((X))>);
};

struct Obj { int x; };

cw<Obj{10}> x;
```
Link: https://godbolt.org/z/zzfMh6b77

Reply via email to