This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81139] New: Non-deduced return type in abbreviated function template


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

            Bug ID: 81139
           Summary: Non-deduced return type in abbreviated function
                    template
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andrew.n.sutton at gmail dot com
  Target Milestone: ---

When a constrained-type-specifier is the same as that of a parameter type, the
return type is not deduced. 


template<typename T> concept bool C = true;

C f(C) { return 0; }

void g() {
  auto x = f("x");
  static_assert(std::is_same<decltype(x), int>::value);
}

The static assertion should fail.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]