mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 12:05:50 +08:00
re PR c++/689 ([diagnostic] this warning is not helpful: `class xxxx' only defines a private destructor and has no friend)
PR C++/689 PR C++/9257 * c-opts.c (c_common_decode_option): Don't set warn_ctor_dtor_privacy wen -Wall. * c-common.c (warn_ctor_dtor_privacy): Don't turn on by default. From-SVN: r66684
This commit is contained in:
parent
9f01ded6a4
commit
f333504d46
@ -1,3 +1,11 @@
|
||||
2003-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
PR C++/689
|
||||
PR C++/9257
|
||||
* c-opts.c (c_common_decode_option): Don't set
|
||||
warn_ctor_dtor_privacy wen -Wall.
|
||||
* c-common.c (warn_ctor_dtor_privacy): Don't turn on by default.
|
||||
|
||||
2003-05-10 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* reload1.c (reload_cse_move2add): Revert part of my 2003-05-09's
|
||||
|
@ -626,7 +626,7 @@ int warn_implicit = 1;
|
||||
/* Nonzero means warn when all ctors or dtors are private, and the class
|
||||
has no friends. */
|
||||
|
||||
int warn_ctor_dtor_privacy = 1;
|
||||
int warn_ctor_dtor_privacy = 0;
|
||||
|
||||
/* Nonzero means warn in function declared in derived class has the
|
||||
same name as a virtual in the base class, but fails to match the
|
||||
|
@ -825,7 +825,6 @@ c_common_decode_option (argc, argv)
|
||||
else
|
||||
{
|
||||
/* C++-specific warnings. */
|
||||
warn_ctor_dtor_privacy = on;
|
||||
warn_nonvdtor = on;
|
||||
warn_reorder = on;
|
||||
warn_nontemplate_friend = on;
|
||||
|
9
gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-1.C
Normal file
9
gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-1.C
Normal file
@ -0,0 +1,9 @@
|
||||
// { dg-options "-Wctor-dtor-privacy" }
|
||||
|
||||
struct C { // { dg-warning "" }
|
||||
static bool result;
|
||||
private:
|
||||
static bool check();
|
||||
};
|
||||
|
||||
bool C::result = check();
|
7
gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-2.C
Normal file
7
gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-2.C
Normal file
@ -0,0 +1,7 @@
|
||||
struct C {
|
||||
static bool result;
|
||||
private:
|
||||
static bool check();
|
||||
};
|
||||
|
||||
bool C::result = check();
|
Loading…
Reference in New Issue
Block a user