This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81139] New: Non-deduced return type in abbreviated function template
- From: "andrew.n.sutton at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jun 2017 14:34:21 +0000
- Subject: [Bug c++/81139] New: Non-deduced return type in abbreviated function template
- Auto-submitted: auto-generated
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.