[Bug c++/93103] New: Generic function syntax does not check return concept
mateusz.pusz at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Dec 30 11:48:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93103
Bug ID: 93103
Summary: Generic function syntax does not check return concept
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mateusz.pusz at gmail dot com
Target Milestone: ---
In the example below `foo` correctly fails the concept check while `boo`
ignores the constraints of the return type:
```
#include <type_traits>
template<typename T>
concept SomeConcept = true;
template<typename T>
concept Integral = std::is_integral_v<T>;
template<SomeConcept T>
Integral auto foo(T t) { return t; }
Integral auto boo(SomeConcept auto t) { return t; }
int main()
{
auto x1 = foo(3.14);
auto x2 = boo(3.14);
}
```
Compiler Explorer link: https://godbolt.org/z/-K39X7.
More information about the Gcc-bugs
mailing list