PR c++/53594
* class.c (check_bases_and_members): Avoid -Wuninitialized
diagnostics for non-static const members or references if they
use NSDMI.
* g++.dg/cpp0x/nsdmi7.C: New test.
From-SVN: r188925
-2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
+2012-06-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/53594
+ * class.c (check_bases_and_members): Avoid -Wuninitialized
+ diagnostics for non-static const members or references if they
+ use NSDMI.
+
+2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
* parser.c (cp_parser_direct_declarator): Move virt-specifier
parsing after late-specified return type parsing.
* parser.c (cp_parser_direct_declarator): Move virt-specifier
parsing after late-specified return type parsing.
- if (TREE_CODE (field) != FIELD_DECL)
+ if (TREE_CODE (field) != FIELD_DECL
+ || DECL_INITIAL (field) != NULL_TREE)
continue;
type = TREE_TYPE (field);
continue;
type = TREE_TYPE (field);
+2012-06-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/53594
+ * g++.dg/cpp0x/nsdmi7.C: New test.
+
2012-06-24 Kai Tietz <ktietz@redhat.com>
* gcc.target/i386/pr23943.c (size_t): Use compatible type-definition
2012-06-24 Kai Tietz <ktietz@redhat.com>
* gcc.target/i386/pr23943.c (size_t): Use compatible type-definition
--- /dev/null
+// PR c++/53594
+// { dg-do compile }
+// { dg-options "-std=c++11 -Wuninitialized" }
+
+struct A
+{
+ const int a = 6; // { dg-bogus "non-static const member" }
+ static int b;
+ int &c = b; // { dg-bogus "non-static reference" }
+};
+
+struct B
+{
+ const int d; // { dg-warning "non-static const member" }
+ int &e; // { dg-warning "non-static reference" }
+ int f = 7;
+};