/cp
2018-04-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84691
* decl.c (grokdeclarator): Clear friendp upon definition in local
class definition error.
/testsuite
2018-04-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84691
* g++.dg/cpp0x/friend3.C: New.
From-SVN: r259716
+2018-04-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/84691
+ * decl.c (grokdeclarator): Clear friendp upon definition in local
+ class definition error.
+
2018-04-27 Jason Merrill <jason@redhat.com>
PR c++/85545 - ICE with noexcept PMF conversion.
if (decl_context == NORMAL)
error ("friend declaration not in class definition");
if (current_function_decl && funcdef_flag)
- error ("can%'t define friend function %qs in a local "
- "class definition",
- name);
+ {
+ error ("can%'t define friend function %qs in a local "
+ "class definition", name);
+ friendp = 0;
+ }
}
else if (ctype && sfk == sfk_conversion)
{
+2018-04-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/84691
+ * g++.dg/cpp0x/friend3.C: New.
+
2018-04-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/82518
--- /dev/null
+// PR c++/84691
+// { dg-do compile { target c++11 } }
+
+template<typename>
+struct a {
+ unsigned b = [] {
+ union {
+ friend void c() {} // { dg-error "local class" }
+ }; // { dg-error "no members" }
+ };
+};