Bug 81139 - Non-deduced return type in abbreviated function template
Summary: Non-deduced return type in abbreviated function template
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: wrong-code
Depends on:
Reported: 2017-06-20 14:34 UTC by Andrew Sutton
Modified: 2017-06-24 16:04 UTC (History)
5 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2017-06-20 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Sutton 2017-06-20 14:34:21 UTC
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.
Comment 1 Tom Honermann 2017-06-24 12:03:38 UTC
Bug 69448 appears to be related.