mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/53594 ([C++11] Spurious -Wuninitialized warning for member with NSDMI)
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
This commit is contained in:
parent
511e47fc2f
commit
f315d61812
|
|
@ -1,4 +1,11 @@
|
||||||
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
|
* parser.c (cp_parser_direct_declarator): Move virt-specifier
|
||||||
parsing after late-specified return type parsing.
|
parsing after late-specified return type parsing.
|
||||||
|
|
|
||||||
|
|
@ -5122,7 +5122,8 @@ check_bases_and_members (tree t)
|
||||||
{
|
{
|
||||||
tree type;
|
tree type;
|
||||||
|
|
||||||
if (TREE_CODE (field) != FIELD_DECL)
|
if (TREE_CODE (field) != FIELD_DECL
|
||||||
|
|| DECL_INITIAL (field) != NULL_TREE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
type = TREE_TYPE (field);
|
type = TREE_TYPE (field);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2012-06-24 Kai Tietz <ktietz@redhat.com>
|
||||||
|
|
||||||
* gcc.target/i386/pr23943.c (size_t): Use compatible type-definition
|
* gcc.target/i386/pr23943.c (size_t): Use compatible type-definition
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 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;
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue