This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67017] Mixing init-declarator for variables and functions in declaration with auto type-specifier
- From: "anders.granlund.0 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 26 Jul 2015 21:07:48 +0000
- Subject: [Bug c++/67017] Mixing init-declarator for variables and functions in declaration with auto type-specifier
- Auto-submitted: auto-generated
- References: <bug-67017-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67017
--- Comment #2 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> EDG and Clang also accept this in C++14 mode (and like GCC, reject it in
> C++11 mode).
I think that is because type deduction for return types of functions was
introduced in c++14.
The following program is well-formed in c++14, but not in c++11:
auto f();
int main() {}