/cp
2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64644
* decl2.c (finish_anon_union): Complain about "anonymous union with
no members" with a pedwarn.
/testsuite
2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64644
* g++.dg/other/anon-union4.C: New.
* g++.old-deja/g++.law/union4.C: Adjust.
* g++.old-deja/g++.other/anon1.C: Likewise.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r252835
+2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/64644
+ * decl2.c (finish_anon_union): Complain about "anonymous union with
+ no members" with a pedwarn.
+
2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
* typeck.c (build_reinterpret_cast_1,
return;
if (main_decl == NULL_TREE)
{
- warning (0, "anonymous union with no members");
+ pedwarn (input_location, 0, "anonymous union with no members");
return;
}
+2017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/64644
+ * g++.dg/other/anon-union4.C: New.
+ * g++.old-deja/g++.law/union4.C: Adjust.
+ * g++.old-deja/g++.other/anon1.C: Likewise.
+
2017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-c++-common/Wcast-align.c: New test.
--- /dev/null
+// PR c++/64644
+
+static union { }; // { dg-error "anonymous union with no members" }
struct SS {
int ss;
};
-};// { dg-warning "no members" }
+};// { dg-error "no members" }
static union {
union {
};
-}; // { dg-warning "" } anonymous union with no members
+}; // { dg-error "" } anonymous union with no members