From: Jason Merrill Date: Mon, 24 Mar 2014 15:55:43 +0000 (-0400) Subject: re PR c++/60574 ([c++1y] ICE with deduced return type in virtual function and LTO) X-Git-Tag: releases/gcc-4.9.0~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0f27fb6b3759484cb51088ee362aeb04df68fde;p=thirdparty%2Fgcc.git re PR c++/60574 ([c++1y] ICE with deduced return type in virtual function and LTO) PR c++/60574 * decl.c (grokdeclarator): Change permerror about 'virtual auto' to error. From-SVN: r208792 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1acfec335f64..7dfb34f6bbb7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-22 Jason Merrill + + PR c++/60574 + * decl.c (grokdeclarator): Change permerror about 'virtual auto' + to error. + 2014-03-21 Paolo Carlini PR c++/60384 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4eb3e69af795..c912ffcb5062 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9553,8 +9553,8 @@ grokdeclarator (const cp_declarator *declarator, "-std=gnu++1y"); } else if (virtualp) - permerror (input_location, "virtual function cannot " - "have deduced return type"); + error ("virtual function cannot " + "have deduced return type"); } else if (!is_auto (type)) { diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn25.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn25.C new file mode 100644 index 000000000000..628a685f722b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn25.C @@ -0,0 +1,15 @@ +// PR c++/60574 +// { dg-options "-flto" } +// { dg-do compile { target c++1y } } + +struct A +{ + virtual auto foo() {} // { dg-error "virtual.*deduced" } +}; + +struct B : A +{ + auto foo(); +}; + +B b;