diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2003-01-13 04:15:29 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-01-13 04:15:29 -0500 |
commit | e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae (patch) | |
tree | cf3cc8fe524a11b4e45ca34dc66696cb7460e49c /gcc/testsuite | |
parent | f576dfc407d1c68d514c2be8c8505c33b00ccee6 (diff) | |
download | gcc-e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae.zip gcc-e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae.tar.gz gcc-e1dfc61b5b97c8ab1ffaeb7c863327e12ee193ae.tar.bz2 |
class.c (maybe_warn_about_overly_private_class): Don't stop searching when we find a nonprivate method.
* class.c (maybe_warn_about_overly_private_class): Don't stop
searching when we find a nonprivate method.
From-SVN: r61248
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/private1.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/private1.C b/gcc/testsuite/g++.dg/warn/private1.C new file mode 100644 index 0000000..c42d6b7 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/private1.C @@ -0,0 +1,16 @@ +// g++ should not complain about A having private [cd]tors. + +class A +{ + A(); + ~A(); +public: + int dummy(); // needed to get bogus warning + static A* get_A (); +}; + +A* A::get_A() +{ + static A a; + return &a; +} |