This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85706] New: [8 regression][concepts] Bogus "deduced class type in function return type"
- From: "Casey at Carter dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 May 2018 19:54:49 +0000
- Subject: [Bug c++/85706] New: [8 regression][concepts] Bogus "deduced class type in function return type"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85706
Bug ID: 85706
Summary: [8 regression][concepts] Bogus "deduced class type in
function return type"
Product: gcc
Version: 8.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Casey at Carter dot net
Target Milestone: ---
Compiling this program:
template<class T> struct S {
S(T);
};
template<class = void>
auto f() -> decltype(S(42)); // error
with "-std=c++17 -fconcepts" produces diagnostics:
/home/casey/casey/Desktop/repro.cpp:6:6: error: deduced class type ‘S’ in
function return type
auto f() -> decltype(S(42)); // Line 6
^
/home/casey/casey/Desktop/repro.cpp:1:26: note: ‘template<class T> struct S’
declared here
template<class T> struct S {
^
the program compiles without diagnostic if f is a non-template:
template<class T> struct S {
S(T);
};
auto f() -> decltype(S(42));