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

andrew.n.sutton at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 20 14:36:00 GMT 2017


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.


More information about the Gcc-bugs mailing list