PR c++/60574
* decl.c (grokdeclarator): Change permerror about 'virtual auto'
to error.
From-SVN: r208792
+2014-03-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/60574
+ * decl.c (grokdeclarator): Change permerror about 'virtual auto'
+ to error.
+
2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60384
"-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))
{
--- /dev/null
+// 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;