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: r188926
This commit is contained in:
parent
139c07de92
commit
2277d6b327
|
@ -1,3 +1,10 @@
|
|||
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-19 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/53651
|
||||
|
|
|
@ -5063,7 +5063,8 @@ check_bases_and_members (tree t)
|
|||
{
|
||||
tree type;
|
||||
|
||||
if (TREE_CODE (field) != FIELD_DECL)
|
||||
if (TREE_CODE (field) != FIELD_DECL
|
||||
|| DECL_INITIAL (field) != NULL_TREE)
|
||||
continue;
|
||||
|
||||
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-22 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
Backport from mainline
|
||||
|
|
|
@ -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