public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16168] New: -Weffc++ item 14 improvements
@ 2004-06-24 2:21 bkoz at gcc dot gnu dot org
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-24 2:21 UTC (permalink / raw)
To: gcc-bugs
This should only warn if the base class has a virtual function. See
std::allocator, plus the base classes.
--
Summary: -Weffc++ item 14 improvements
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bkoz at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/16168] -Weffc++ item 14 improvements
2004-06-24 2:21 [Bug c++/16168] New: -Weffc++ item 14 improvements bkoz at gcc dot gnu dot org
@ 2004-06-28 19:33 ` bangerth at dealii dot org
2004-06-28 20:16 ` Gabriel Dos Reis
2004-06-28 20:14 ` gdr at acm dot org
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-06-28 19:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-06-28 19:29 -------
Here's a testcase:
------------
struct A {
~A ();
};
struct B : public A {};
------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
x.cc:5: warning: base class `struct A' has a non-virtual destructor
I'm not really sure whether we want to avoid the error message here,
but I guess it makes sense if there are no virtual functions.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-06-28 19:29:51
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bug c++/16168] -Weffc++ item 14 improvements
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
@ 2004-06-28 20:16 ` Gabriel Dos Reis
0 siblings, 0 replies; 6+ messages in thread
From: Gabriel Dos Reis @ 2004-06-28 20:16 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
You Wrote bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org 2004-06-28
> 19:29 -------
> Here's a testcase:
> ------------
> struct A {
> ~A ();
> };
>
> struct B : public A {};
> ------------
> g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
> x.cc:5: warning: base class `struct A' has a non-virtual destructor
>
> I'm not really sure whether we want to avoid the error message here,
It does not make much sense in the context of modern C++. In
particular, you get that noise each time you derive from
std::iterator<> or std::unary_function<> or such.
> but I guess it makes sense if there are no virtual functions.
No, it does not. See above. Even when there are virtual
functions, it is pretty useless when emitted unconditionally.
We had this discussion in the PR filled by Nathan Myers.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/16168] -Weffc++ item 14 improvements
2004-06-24 2:21 [Bug c++/16168] New: -Weffc++ item 14 improvements bkoz at gcc dot gnu dot org
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
@ 2004-06-28 20:14 ` gdr at acm dot org
2004-06-28 20:51 ` bangerth at dealii dot org
2005-03-29 1:49 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: gdr at acm dot org @ 2004-06-28 20:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at acm dot org 2004-06-28 20:14 -------
Subject: Re: -Weffc++ item 14 improvements
You Wrote bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org 2004-06-28
> 19:29 -------
> Here's a testcase:
> ------------
> struct A {
> ~A ();
> };
>
> struct B : public A {};
> ------------
> g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -Weffc++ -c x.cc
> x.cc:5: warning: base class `struct A' has a non-virtual destructor
>
> I'm not really sure whether we want to avoid the error message here,
It does not make much sense in the context of modern C++. In
particular, you get that noise each time you derive from
std::iterator<> or std::unary_function<> or such.
> but I guess it makes sense if there are no virtual functions.
No, it does not. See above. Even when there are virtual
functions, it is pretty useless when emitted unconditionally.
We had this discussion in the PR filled by Nathan Myers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/16168] -Weffc++ item 14 improvements
2004-06-24 2:21 [Bug c++/16168] New: -Weffc++ item 14 improvements bkoz at gcc dot gnu dot org
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
2004-06-28 20:14 ` gdr at acm dot org
@ 2004-06-28 20:51 ` bangerth at dealii dot org
2005-03-29 1:49 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-06-28 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-06-28 20:47 -------
I meant "It makes sense to avoid this warning in this case". We're in
agreement here.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/16168] -Weffc++ item 14 improvements
2004-06-24 2:21 [Bug c++/16168] New: -Weffc++ item 14 improvements bkoz at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-06-28 20:51 ` bangerth at dealii dot org
@ 2005-03-29 1:49 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-29 1:49 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Last reconfirmed|2004-12-28 01:41:09 |2005-03-29 01:49:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16168
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-03-29 1:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-24 2:21 [Bug c++/16168] New: -Weffc++ item 14 improvements bkoz at gcc dot gnu dot org
2004-06-28 19:33 ` [Bug c++/16168] " bangerth at dealii dot org
2004-06-28 20:16 ` Gabriel Dos Reis
2004-06-28 20:14 ` gdr at acm dot org
2004-06-28 20:51 ` bangerth at dealii dot org
2005-03-29 1:49 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).